PKDemon Posted April 21, 2012 Author Share Posted April 21, 2012 i have been looking throw the code and trying to learn how everything is done but there is one thing that i would like to add but my knowledge with EO is limitedi am trying to make a packet where u can send a command through like php to be able to display the total people online (in a number) and another one to list all the character names that is onlinei have been trying but all i have came up with is this little bit of code and dont even know if it will workonly thing i can figure out is how to set it up when i send the command to the server how to send the data back to whatever sent the commandbut here is what little bit of code i have came up with```If IsLoggedIn = True ThenIf GetPlayerAccess(index) = 9 Thens = s & "**" & GetPlayerName(index) & "**"Elses = s & GetPlayerName(index)End IfEnd If``` Link to comment Share on other sites More sharing options...
PKDemon Posted April 23, 2012 Author Share Posted April 23, 2012 anyone out there ? Link to comment Share on other sites More sharing options...
Justn Posted April 23, 2012 Share Posted April 23, 2012 Here is a packet tutorial not sure if it will help http://www.touchofdeathforums.com/smf/index.php/topic,69393.0.html Link to comment Share on other sites More sharing options...
PKDemon Posted April 24, 2012 Author Share Posted April 24, 2012 i will look through the post and see what i can come up with but what i am having problems with is that how i send the command from a php script to the server and then the server send the info back to the script to display it Link to comment Share on other sites More sharing options...
The New World Posted April 24, 2012 Share Posted April 24, 2012 Why're you using a PHP script in EO?EO utilizes a byte packet array system. If you follow the patterns used in modClientTCP, modHandleData, modEnumerations and modServerTCP you'll find a grand example of how packets work in EO.You use an instance of the buffer class, which can be found in each project (client and server) and write your data. Then the recipient handles that data through the modHandleData procedures.In this case, you'd have something trigger the packet to be sent, maybe the client loading the GUI, and it'll send the packet you've written in modClientTCP, say you named it GetPlayersOnline, and then when the Server received this packet with modHandleData.It would then process the received information through a defined procedure in that module, and in turn send another packet with ServerTCP that returns the requested information, which once again, is then handled by the module modHandleData by the Client.The client then uses its handling code written in that module, to receive the information sent by the server.The tutorial provided above shows all this and more. Link to comment Share on other sites More sharing options...
PKDemon Posted April 24, 2012 Author Share Posted April 24, 2012 @[rose:> link=topic=79593.msg853673#msg853673 date=1335228823]> Why're you using a PHP script in EO?> > EO utilizes a byte packet array system. If you follow the patterns used in modClientTCP, modHandleData, modEnumerations and modServerTCP you'll find a grand example of how packets work in EO.> > You use an instance of the buffer class, which can be found in each project (client and server) and write your data. Then the recipient handles that data through the modHandleData procedures.> > In this case, you'd have something trigger the packet to be sent, maybe the client loading the GUI, and it'll send the packet you've written in modClientTCP, say you named it GetPlayersOnline, and then when the Server received this packet with modHandleData.> > It would then process the received information through a defined procedure in that module, and in turn send another packet with ServerTCP that returns the requested information, which once again, is then handled by the module modHandleData by the Client.> > The client then uses its handling code written in that module, to receive the information sent by the server.> > The tutorial provided above shows all this and more.what i mean by using php issending a command to the server say like "getnames" to the server using php and then when the server gets that command it will then get all the names of the players that are online (if any) and then send that information back to the php script which in return will display it on the website Link to comment Share on other sites More sharing options...
The New World Posted April 24, 2012 Share Posted April 24, 2012 Well since these packets work as byte arrays, you have to match their format.I'm no PHP expert but explore the clsBuffer and try [this](http://stackoverflow.com/questions/2473203/how-to-write-byte-by-byte-to-socket-in-php)?All you really have to send is the data telling the server what packet its receiving so it knows how to handle it. Link to comment Share on other sites More sharing options...
PKDemon Posted April 24, 2012 Author Share Posted April 24, 2012 well i know there is another 2g engine out there that does i am trying to do on this engine but i dont like the other enigine so i guess i will keep trying and trying until i get it to work i guess or someone else figures it out Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now