- Home /
The question is answered, right answer was accepted
SQL Connection doesn't work in standalone/build
Well hello there once again, for the past few days I managed to make a Script for my MMO which works the following way:
First of all a connection to the Master Server is established (using, Network.Connect)
then the user sees the login/register screen, where he'll connect to the database and either create a new account or check if the password and username are correct, so that the userID and player data canbe load into the game.
Now my problem: That works all just too well, if I try it out in Unity, but if I build the project and try it out as a standalone .exe it just won't work..
both sending confirmation email and connecting to the DB doesn't seem to work in standalone.. help :O
The question is still bugging but I am currently making a workaround for it, but I still would like to know an explanation or even a solution for this :I
Going to need a lot more information. Are you logging errors? Also, is the client connecting directly to the database, or do you mean "server"? Connecting the client directly to the database is NOT the way to go for an $$anonymous$$$$anonymous$$O.
erm Firstly: I am catching Error message by using the Try{} catch() code segment, however, I just tested it, it doesn't even reach that points, it's like the Standalone just can't use the SQL commands at all.
Secondly: I am aware that the client shouldn't directly connect to the server, but it's at the moment a test, I want to shift that later to the server exe. But since that would be a standalone as well, it wouldn't work there as well, so untill it's working for the regular client.exe I can't assume that it will work for the server.exe
Thirdly: I am currently working to let the Editor version handle everything but that's not what I want later on, I want the master server to run without Unity.. :I
I reworked the code and made all the SQL and S$$anonymous$$TP stuff serverside, yet it only works in the Editor, if I compile and build the standalone .exe it won't connect to the SQL server properly. Any explanation/Solution?
Add some Debug.Log
s into your script code, then post here the player.log
. I suspect that the standalone is failing because it cannot locate your DLLs.
Answer by Cerbion_ · Jul 22, 2013 at 11:37 AM
I finally found the answer myself and thanks to this post: http://answers.unity3d.com/questions/42955/codepage-1252-not-supported-works-in-editor-but-no.html
However, the answer is that there are a bunch of neccessary .DLL files (l18N) who need to be imported into the assets of the project in order to work, I simply copied them from
C:\\Program Files (x86)\\Unity\\Editor\\Data\\Mono\\lib\\mono\\unity
to a folder in my project called 'Plugins' and it works just as well as I hoped to! :)
Hey thanks for sharing the fix, just to clarify did you create a folder called 'Plugins' and put it in there? Because I cannot find such a folder. Also you put this into your standalone projects data folder right? Hope your still active. Thankyou.
Hey this is a long shot, but we're trying the same methods, and it works for android build, but iPhone constantly crashes when opening the connection, is there something we're missing?
Thanks dude i fixed my mysql connection problems after build with this method
Follow this Question
Related Questions
MSSQL Connection and Select 2 Answers
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
How To send Email with C# on Unity 3D 4.1.2? 8 Answers
Unity Like Facebook Page through app 3 Answers