public void ServerExiting(EGSConnectionError error = EGSConnectionError.AuthenticationError, string reason = "") { ConnectionStatus = EConnectionStatus.Failed; if (ServerConnectionClosed != null) ServerConnectionClosed(ConnectedTo, error, reason); if (ticket != HAuthTicket.Invalid) { SteamUser.CancelAuthTicket(ticket); ticket = HAuthTicket.Invalid; } if (SubmittedTicket) { SteamUser.EndAuthSession(ConnectedTo); SubmittedTicket = false; } if (ConnectedTo.IsValid()) SteamNetworking.CloseP2PSessionWithUser(ConnectedTo); _ConnectedTo = CSteamID.Nil; }
void SendFailedConnection(CSteamID recip, EGSConnectionError connectionError, string reason = "") { Packet packet = new Packet(this, true, Packet.PACKET_AUTHFAILED); packet.Write((int)connectionError); if(reason != string.Empty) { packet.Write(reason); } packet.Send(EP2PSend.k_EP2PSendReliable, 0, recip); }