public void ProcessOutgoingData() { if (HasDataToSend()) { foreach (var packet in outGoingPackets) { if (packet.PacketType == PacketType.ServerPingHopper) { string name = Assembly.GetCallingAssembly().GetName().Name; (packet as ServerPingHopperPacket).Stamp(name + " sending to client"); } connection.Send(packet); } outGoingPackets.Clear(); } }
public void NewPlayerLoginResult(PlayerConnectionState playerConnection, bool success, PlayerSaveState save) { if (success == true) { int connectionId = nextGateWayPlayerConnectionId++; UserSocket gp = new UserSocket(connectionId, this, playerConnection, save.accountId); playerConnection.finishedLoginSuccessfully = success; // Get the server instance id lock (connectedLock) { players.Add(gp); } PassSaveStateToGameServer(playerConnection.gameId, connectionId, save); gp.HasNotifiedGameServer = true; } LoginCredentialValid lcv = (LoginCredentialValid)IntrepidSerialize.TakeFromPool(PacketType.LoginCredentialValid); lcv.isValid = success; playerConnection.Send(lcv); }