3 registered members (NewbieZorro, TipmyPip, 1 invisible),
19,045
guests, and 8
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: MySQL instructions
[Re: TSG_Torsten]
#273397
06/22/09 19:16
06/22/09 19:16
|
Joined: Oct 2008
Posts: 513
Carlos3DGS
User
|
User
Joined: Oct 2008
Posts: 513
|
I have been playing around with lite-c for a few months and wanted to try out a mutiplayer rpg now that I feel at home with this language. I have finally bought A-Net today and will start with that manual tonight.
I would also need a database for my game and have a few questions. My database is not for serverlists, it is for items/players/mobs/skills stats and stuff like that. My game server will be on one computer on my lan and my mysql server will be on another computer also on my lan, the clients will conect from internet (I have set up port forwarding on my router to my game server computer).
I do not know anything about php, but what I do know is that I do not want clients to access my database, only the server will. The game server and the database server will both be on the same lan (not accessed through internet, because i need direct fast access through lan since there will be lots of traffic. For example: each time a player attacks I have to do several "selects", one on the player database for his attributes and equipped weapon, then on the weapons database for the damage, (do calculations with player str, dex and weapon damage), and then again another select on the player database for the defenders attributes and equipped armour, and again on the items database for the armor properties and do final calculations with defender's dex, constitution and armor).
I have lots of experience with SQL as it was one of my courses at my university, but unfortunately I have no experience with php yet. I was wondering... since I do not need my clients to access my database from the internet... could I connect my gs/anet server to mysql server on the same lan and pass it the queries directly withought having to use php?
(mabe it sounds like a stupid question because I still have not learned anet and have no idea of php)
Last edited by Carlos3DGS; 06/22/09 19:18.
|
|
|
Re: MySQL instructions
[Re: Damocles_]
#273590
06/23/09 15:58
06/23/09 15:58
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
Serious User
|
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
A direct connection to MySQL is not supported, but over php you can easily get access. Here a german site explaining php-sql programming in detail: http://www.schattenbaum.net/php/But for php you will also need a webserver? (sorry, but I have no clue of how the servers have to be set up).
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)! get free version
|
|
|
Re: MySQL instructions
[Re: Dark_samurai]
#274006
06/25/09 10:32
06/25/09 10:32
|
Joined: Oct 2008
Posts: 513
Carlos3DGS
User
|
User
Joined: Oct 2008
Posts: 513
|
I have a few of questions. -Can anyone point me to a MySQL plugin like that? (Lite-C to MySQL) -do you know of a php-sql web like that but in english? -In the ANet manual it says "the latest VC 2008 Redistributable Package must be installed", will the pc running the final client also need to install this? -My server and client will be two different gs applications because I dont want them to have my server code. In the manual I read this "It's better to use Lite-C instead of C-Script. Some functions like enet_send_var cause much less traffic in Lite-C. In Lite-C you can only use clients and servers that are started with exactly the same version of your game. In C-Script, you can use different Versions." but I also read this other thing in the manual "Please notice: If enet_send_var, enet_send_array or enet_send_string are used in Lite-C, all clients and the server has to be started with the same application (= the same source code)! Please notice also that all clients and the server have to use the same scripting language!" . So I wanted to know... if I use Lite-C, will those three functions be the only ones i cannot use? If there are more, what other functions will not work?
|
|
|
Re: MySQL instructions
[Re: Carlos3DGS]
#274013
06/25/09 11:06
06/25/09 11:06
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
Serious User
|
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
-Can anyone point me to a MySQL plugin like that? (Lite-C to MySQL) This is the one from Joozey: http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=220503&page=1-do you know of a php-sql web like that but in english? Google result: http://www.freewebmasterhelp.com/tutorials/phpmysql/2-In the ANet manual it says "the latest VC 2008 Redistributable Package must be installed", will the pc running the final client also need to install this? This should be automatically be installed on all new pc's. The old ones have to install that, yes! But that would also be the same when anet would be written with older vc++ versions. -My server and client will be two different gs applications because I dont want them to have my server code. Lite-C uses the handle of vars, arrays and strings by default. This causes less traffic then using the name of those elements. C-Script has no handle function like that => names are used by default. You can switch the Lite-C mode to also use the names with the function anet_use_handles(). But I would dehort you to use the variable names, better find a methode to protect your code so that they can't get access to the server code.
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)! get free version
|
|
|
Re: MySQL instructions
[Re: Dark_samurai]
#274308
06/26/09 13:21
06/26/09 13:21
|
Joined: Oct 2008
Posts: 513
Carlos3DGS
User
|
User
Joined: Oct 2008
Posts: 513
|
I had also found that plugin by Joozey, but it only connects to his own database which is not viable for this project. and also he said: It's suspended for an undefined amount of time. Do you now of any other MySQL plugin? You can switch the Lite-C mode to also use the names with the function anet_use_handles(). But I would dehort you to use the variable names, better find a methode to protect your code so that they can't get access to the server code. Im afraid having the server code on the clients is not a good option. The code is compiled in ann exe and that would be sufficient to protect from the average user, but I would prefer not to have any part of the server code there for more advanced users. I will take a look at the function anet_use_handles(). Thanks for the info 
|
|
|
|