private void HandleConnected(NetConnection sender) { NetSessionId session; if (IsClient) { session = new NetSessionId(sender.RemoteHailMessage.ReadString()); } else { session = _assignedSessions[sender]; } var channel = new NetChannel(this, sender, session); _channels.Add(sender, channel); _strings.SendFullTable(channel); Logger.InfoS("net", $"{channel.RemoteEndPoint}: Connected"); // client is connected after string packet get received if (IsServer) { OnConnected(channel); } }
private void HandleConnected(NetConnection sender) { var channel = new NetChannel(this, sender); _channels.Add(sender, channel); _strings.SendFullTable(channel); Logger.Info($"[NET] {channel.RemoteAddress}: Connected"); OnConnected(channel); }
private void HandleInitialHandshakeComplete(NetConnection sender) { var session = _assignedSessions[sender]; var channel = new NetChannel(this, sender, session); _channels.Add(sender, channel); _strings.SendFullTable(channel); Logger.InfoS("net", $"{channel.RemoteEndPoint}: Connected"); OnConnected(channel); }
private void HandleConnected(NetConnection sender) { var channel = new NetChannel(this, sender); _channels.Add(sender, channel); _strings.SendFullTable(channel); Logger.Info($"[NET] {channel.RemoteAddress}: Connected"); // client is connected after string packet get received if (IsServer) { OnConnected(channel); } }
// server-side disconnect private void DisconnectChannel(NetChannel channel, string reason) { channel.Connection.Disconnect(reason); }