protected virtual void HandleConnect(int clientConnectionId, byte error) { if (IsServer) { if (ConnectionId != clientConnectionId) { LLNetworkConnection newConnection = new LLNetworkConnection(clientConnectionId, SocketId); ClientConnections.Add(clientConnectionId, newConnection); OnServerConnect(newConnection); } else { ServerConnection = new LLNetworkConnection(clientConnectionId, SocketId); OnClientConnect(ServerConnection); SetClientConnectedStates(); } } else { if (ConnectionId != clientConnectionId) { return; } ServerConnection = new LLNetworkConnection(clientConnectionId, SocketId); OnClientConnect(ServerConnection); SetClientConnectedStates(); } }
protected virtual void OnData(LLNetworkConnection connection, int channelId, int receivedSize) { NetworkReader reader = new NetworkReader(msgBuffer); while (reader.Position < receivedSize) { short msgType = reader.ReadInt16(); } }
protected virtual void OnClientDisconnect(LLNetworkConnection connection) { Debug.Log("OnClientDisconnect " + name + " " + connection.ConnectionId); }