|
Post by Wayne Rayner on Jan 10, 2010 0:44:07 GMT -5
You see I want the server to hold the game data and the client once it's connected loads the game data from the server. Could this work? The reason why is if I create a little mmo and I want to update it, it would be annoying to tell everyone to download a new client with moddified game.
Yours Wayne Rayner
|
|
|
Post by crazynate on Jan 10, 2010 14:08:44 GMT -5
have one program that connects to the server to login and check for updates on the last line of the login program have "include game.gb" if there's an update, you could use a file share program to send the new client program to the user as game.gb since "include game.gb " is on the last line the program, after the login program updates the game the program can continue running without the user having to reset the application
|
|
|
Post by alovon on Jan 10, 2010 14:26:06 GMT -5
Thats a clever idea. Although wouldn't that make the game "hackable"? Correct me if I'm wrong but I do believe you can open up a .gb file with any text editor, and the code will appear the same. Wouldn't that allow the player to modify values and cheat?
|
|
|
Post by crazynate on Jan 10, 2010 15:07:59 GMT -5
not if the login is an executable and the game file is embed
|
|
|
Post by alovon on Jan 10, 2010 15:25:20 GMT -5
Haha my bad. I didn't think of that.
|
|
|
Post by DJLinux on Jan 10, 2010 16:08:25 GMT -5
do you talk about the TCP plugin ?
Joshy
|
|
|
Post by Wayne Rayner on Jan 10, 2010 19:50:19 GMT -5
Yea the TCP plugin you created DJLinux. I just want the game to be in the server and the person logs in the server verifies whether the user exists in the server if yes then continues to playing the game. Also if the game is in the server when the player logs out the server knows where that person logged out from.
Crazynate I know where you are coming from but no, it's easier to update it my way trust me.
Yours Wayne Rayner
|
|
|
Post by Wayne Rayner on Jan 11, 2010 6:06:37 GMT -5
ok this it'm confused. DJLinux could you help me please?
server code (not quite completed)
' server
' declare constants and variables const PORT = 1111 dim server = TCPCreateServer (PORT) dim client
if server > 0 then printr "Server Online" endif
now the client code
' client
' declare conststants and variables const PORT = 1111 const SERVER$ = "128.8.8" dim connection = TCPCreateClient (SERVER$,PORT) dim opt_in dim log_username$, log_password$ dim reg_username$, reg_password$
printr "To login press 1, to register press 2." input opt_in
if opt_in = 1 then printr "Login" print "whats your username: " input log_username$ TCPWriteString (connection, log_username$) print "whats your password: " input log_password$ TCPWriteString (connection, log_password$) elseif opt_in = 2 then printr "Register" printr "What would you like your username to be?:" input reg_username$ TCPWriteString (connection, reg_username$) printr "What would you like your password to be?:" input reg_password$ TCPWriteString (connection, reg_password$) endif
qustion: How would I get the server to write the username and the password that the client sent to server into a text file named users.txt
This is the first question there might be another one after this question is answered.
Thanks for helping Wayne Rayner
|
|
|
Post by DJLinux on Jan 11, 2010 11:09:18 GMT -5
TCP Server commands
Create and Delete a Server hServer%=TCPCreateServer(Port%)
Boolean%=TCPDeleteServer()
is any new client connected to server? hClient%=TCPClientConnected()
is any client disconnected from server? hClient%=TCPClientDisconnected()
is any client data aviable ? hClient%=TCPClientData()
TCP Client commands
Create and delete Client (Server$ can be the hostname or IP) hConnection%=TCPCreateClient(Server$,Port%) Boolean%=TCPDeleteClient(hClient%)
is any server data aviable ? Boolean%=TCPServerData(hConnection%)
Server and Clients commands nChars%=TCPWriteString(hServer% or hClient%, Text$) nChars%=TCPReadString(hServer% or hClient%, Text$)
this are all simple TCP commands very easy and File I/O commands are included in Basic4GL.
tip: hFile = OpenFileWrite ("yourfile.txt")
WriteString(hFile, "what ever") ... ... CloseFile (hFile)
thats all
Joshy
|
|