I am not asking for the code im asking for the best way to do something.
So I have at the moment this class:
package com.definem.ws.alpha;
public class Event {
private enum EventTypes{
WCHARAK,CONNECT,DISCONNECT,CCHAR,DCHAR,DEVLOGIN
}
}
Not really mutch an actually not using it.
I found this code to be not tutorial worthy.
The server is working (and you see a couple of people walk and such) but my question is:
- What's the best way to implement a event system
What I mean by this, you have an user that clicks on npc1 so the client will do this lets say:
if(Player.clicked(npc1)){
Printwriter.println("talk" + 1);
}
how could i make an event system that is usable on server as client aswell.
like PlayerDied,PlayerLoot,PlayerCommand,PlayerRevived
do I use enums and print a that enum when you do something?
- Do you store the npc's state(event) on the server on the client?
This is for later, when you have 10 npc's on one map, you will need a thread i suppose and then put them in a hashmap
itterate over that hashmap and set them all to a specific event ?
- Do you create a Hashmap,list with all the connected user's on a specific map ?
This is more of a desinger faulth of my server, I don't store all the connected user's anyware.
I just let them connect but I don't see where they are and such.
I wrote a small text beneath each question that explains all things and sometimes give's an example anwser
but are there better solutions?
Thanks,Arno(Cornetto456)

New Topic/Question
Reply



MultiQuote




|