Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2013
    Thanked 0 Times in 0 Posts

    Will java help me with online mafia games

    Hello. I apologise in advance as this could be the complete wrong place to be speaking about this. I have a very stressful job, and when I can I play a gangster game on the internet, purely text based and php coded. I already have a script running on the game which allows me to captcha every user that comes online and takes a list of the users online every 10 mins. When these builld up I have a lot of names. I was wondering if there was something I could do, or make, which allows me to put all the names in, so it sorts them out. For example, it will put all dead accounts and below a certain rank in one list, and the rest in another list. This way it saves me hours and hours of many power to do it all by hand. Sorry this might be the wrong place and it might not make sense, but I'm trying to word it so people who do not play the game understand. I would appreciate the help if possible, ty

  2. #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Saskatoon, Saskatchewan
    Thanked 2,668 Times in 2,637 Posts
    I don't understand the question, nor where Java comes into this.
    You can do all you're asking for using the server side language already in use. By dead accounts, I assume you mean no longer active in session, not accounts that are inactive since they have no relevance.
    In order to do what you want, you'll need to either:
    Write custom session handlers and preferably a dbms to store them in. This lets you select where newer than a certain age, and order them. It also allows purging.
    Or: write a custom parser for the existing PHP sessions. Iterate a *custom* directory (do NOT use the default location for sessions; that can get you in a lot of trouble on a shared host) where you store your sessions, and read and parse every session file. This will let you read the user information out of it to build the list. Do not be tricked into believing that PHP session files are standard serialized - they look like they are, but they are not. You can use the WDDX setting though, which can be used in conjunction with wddx_deserialize making it a lot easier.

    Although, to add for the Java perspective, than yes this would be easier. Java applets would be run on a client side, so you can establish RMI connectivity to a base server. When the user leaves, it can be detected by the server, and they can be removed from the list.
    This is pretty much how java chats worked way back in the day.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts