void GameServer_ServersConnectFailure(SteamSDK.Result result)
 {
     MyLog.Default.WriteLineAndConsole("Server connect failure (" + result.ToString() + ")");
 }
        void GameServer_ValidateAuthTicketResponse(ulong steamID, SteamSDK.AuthSessionResponseEnum response, ulong steamOwner)
        {
            MyLog.Default.WriteLineAndConsole("Server ValidateAuthTicketResponse (" + response.ToString() + "), owner: " + steamOwner.ToString());

            if (response == AuthSessionResponseEnum.OK)
            {
                if (MemberLimit > 0 && m_members.Count - 1 >= MemberLimit) // Unfortunately, DS counds into the members, so subtract it
                {
                    UserRejected(steamID, JoinResult.ServerFull);
                }
                else if (m_groupId == 0 || MySandboxGame.ConfigDedicated.Administrators.Contains(steamID.ToString()) || MySandboxGame.ConfigDedicated.Administrators.Contains(ConvertSteamIDFrom64(steamID)))
                {
                    UserAccepted(steamID);
                }
                else if (SteamServerAPI.Instance.GetAccountType(m_groupId) != AccountType.Clan)
                {
                    UserRejected(steamID, JoinResult.GroupIdInvalid);
                }
                else if (SteamServerAPI.Instance.GameServer.RequestGroupStatus(steamID, m_groupId))
                {
                    // Returns false when there's no connection to Steam
                    m_waitingForGroup.Add(steamID);
                }
                else
                {
                    UserRejected(steamID, JoinResult.SteamServersOffline);
                }
            }
            else
            {
                JoinResult joinResult = JoinResult.TicketInvalid;
                switch (response)
                {
                    case AuthSessionResponseEnum.AuthTicketCanceled:
                        joinResult = JoinResult.TicketCanceled;
                        break;
                    case AuthSessionResponseEnum.AuthTicketInvalidAlreadyUsed:
                        joinResult = JoinResult.TicketAlreadyUsed;
                        break;
                    case AuthSessionResponseEnum.LoggedInElseWhere:
                        joinResult = JoinResult.LoggedInElseWhere;
                        break;
                    case AuthSessionResponseEnum.NoLicenseOrExpired:
                        joinResult = JoinResult.NoLicenseOrExpired;
                        break;
                    case AuthSessionResponseEnum.UserNotConnectedToSteam:
                        joinResult = JoinResult.UserNotConnected;
                        break;
                    case AuthSessionResponseEnum.VACBanned:
                        joinResult = JoinResult.VACBanned;
                        break;
                    case AuthSessionResponseEnum.VACCheckTimedOut:
                        joinResult = JoinResult.VACCheckTimedOut;
                        break;
                }

                UserRejected(steamID, joinResult);
            }
        }
 void GameServer_ServersDisconnected(SteamSDK.Result result)
 {
     MyLog.Default.WriteLineAndConsole("Server disconnected (" + result.ToString() + ")");
 }
Exemplo n.º 4
0
 void Peer2Peer_ConnectionFailed(ulong remoteUserId, SteamSDK.P2PSessionErrorEnum error)
 {
     MyLog.Default.WriteLineAndConsole("Peer2Peer_ConnectionFailed " + error.ToString());
 }