void OnSessionCallback(byte[] arguments) { SSessionPacket SessionPacket = CSerialization.Deserialize <SSessionPacket>(arguments); if (SessionPacket.Packet == ESessionPackets.Introduction) { ClientSocket.SendPacket <SSessionPacket>((byte)EClientPackets.Session, SessionPacket); } }
private void ClientSocket_OnClientConnected() { //Tell the server that this is a client byte[] buffer = BitConverter.GetBytes((int)2); ClientSocket.SendBuffer(buffer); SClientIntroduction ClientIntroduction = new SClientIntroduction { UserName = Environment.UserName, OperatingSystem = new Microsoft.VisualBasic.Devices.ComputerInfo().OSFullName //sure there are better ways, but for the sake of open-source - i don't really care }; //Send the introduction ClientSocket.SendPacket <SClientIntroduction>((byte)EClientPackets.Introduction, ClientIntroduction); }