protected override void OnReceived(byte[] buffer, long offset, long size) { string message = Encoding.UTF8.GetString(buffer, (int)offset, (int)size); Console.WriteLine("Incoming: " + message); // update game state on server side _protocol.ToHigherLayer(buffer, offset, size, this.OtherInstruction); // Multicast message to all connected sessions Server.Multicast(message); // If the buffer starts with '!' the disconnect the current session if (message == "!") { Disconnect(); } }
protected override void OnReceived(byte[] buffer, long offset, long size) { _protocol.ToHigherLayer(buffer, offset, size, this.OtherInstruction); }