Hiho,
ich habe ein Problem mit dem MySQL Connector in MonoDevelop bzw mit Unity3D. Ich habe die aktuellste Version heruntergeladen und die v2 .dll's in MonoDevelop eingebunden.
Daraufhin habe ich ganz normal begonnen:
|
C#-Quelltext
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
using UnityEngine;
using System.Collections;
using MySql.Data.MySqlClient;
public class server : MonoBehaviour {
string data;
void Start () {
//Initialize Server
Network.InitializeServer(32, 25000, false);
}
void OnGUI () {
GUI.Label(new Rect(0,0,100,100),data);
}
[RPC]
void Chat (string text, NetworkMessageInfo info){
Debug.Log(text + " from " + info.sender);
}
[RPC]
void Login (string text, NetworkMessageInfo info){
//Request
string[] loginarray;
loginarray = text.Split(new char[]{'|'});
if(loginarray!=null && loginarray.Length >1)
{
string username = loginarray[0];
string password = loginarray[1];
//Database
string dbConStr = "Server=localhost;Port=3306;Database=kyeile;Uid=root;Password=''";
MySqlConnection dbCon = new MySqlConnection(dbConStr);
MySqlCommand dbCmd = dbCon.CreateCommand();
//Query
dbCmd.CommandText = "";
try
{
}catch(ex){
Debug.LogError(ex.Message);
}
}
}
}
|
Das Problem ist Unity3D gibt mir diese Fehlermeldung zurück:
Assets/server.cs(35,25): error CS0433: The imported type `MySql.Data.MySqlClient.MySqlConnection' is defined multiple times
Assets/server.cs(36,25): error CS0433: The imported type `MySql.Data.MySqlClient.MySqlCommand' is defined multiple times
Da ich in Google nichts finden konnte und schon seit 3 Stunden da mit 2 aus dem Unity Insider Forum dran fest sitze dachte ich, ich frag mal hier im Forum nach.
Ich hoffe hier hat jmd. eine grobe Ahnung woran das liegen könnte. Bedanke mich schon mal eure für Hilfe
Mit freundlichen Grüßen
Tixewi