/// <summary> /// When a client connects to the server /// </summary> /// <param name="s"></param> /// <param name="new_client"></param> /// <returns></returns> public bool ClientConnect(RedCorona.Net.Server s, ClientInfo new_client) { new_client.Delimiter = "\n"; new_client.OnRead += ReadClient; //Read client messages new_client.OnClose += New_client_OnClose; Player np = new Player(new_client.ID); PlayerLookup.Add(new_client.ID, np); // Add a client to our listing. ClientTable.Add(new_client.ID, new_client); OurServer.PlayerConnected(np); return(true); }
bool ClientConnect(Server serv, ClientInfo new_client) { new_client.Delimiter = "\n"; new_client.OnRead += new ConnectionRead(ReadData); return true; // allow this connection }
public void Start() { server = new Server(2345, new ClientEvent(ClientConnect)); }
/// <summary> /// Start a new server /// </summary> public void StartServer() { Server_ = new RedCorona.Net.Server(PORT, new ClientEvent(ClientConnect)); }
bool ClientConnect(Server serv, ClientInfo new_client) { new_client.MessageType = MessageType.CodeAndLength; new_client.OnReadMessage += new ConnectionReadMessage(ReadMessage); return true; // allow this connection }
bool ClientConnect(Server s, ClientInfo ci) { ci.Delimiter = "\r\n\r\n"; ci.Data = new ClientData(ci); ci.OnRead += new ConnectionRead(ClientRead); ci.OnReadBytes += new ConnectionReadBytes(ClientReadBytes); return true; }
public HttpServer(Server s) { this.s = s; s.Connect += new ClientEvent(ClientConnect); handlers.Add(new FallbackHandler()); }
public void disconnect() { server.Close(); server = null; }