예제 #1
0
파일: User.cs 프로젝트: conankzhang/fez
        public void AdvertiseGame(SteamID gameServerSteamID, IPAddress ip, ushort port)
        {
            byte[] addressBytes = ip.GetAddressBytes();
            uint   serverIP     = (uint)((int)addressBytes[0] << 24 | (int)addressBytes[1] << 16 | (int)addressBytes[2] << 8) | (uint)addressBytes[3];

            User.SteamUnityAPI_SteamUser_AdvertiseGame(this._user, gameServerSteamID.ToUInt64(), serverIP, port);
        }
예제 #2
0
        public void SendP2PPacket(SteamID steamID, byte[] data, EP2PSend sendType, int channel = 0)
        {
            IntPtr num = Marshal.AllocHGlobal(data.Length);

            Marshal.Copy(data, 0, num, data.Length);
            Networking.SteamUnityAPI_SteamNetworking_SendP2PPacket(this._networking, steamID.ToUInt64(), num, (uint)data.Length, (byte)sendType, channel);
            Marshal.FreeHGlobal(num);
        }
예제 #3
0
파일: User.cs 프로젝트: conankzhang/fez
 public EUserHasLicenseForAppResult UserHasLicenseForApp(SteamID steamID, uint appID)
 {
     return(User.SteamUnityAPI_SteamUser_UserHasLicenseForApp(this._user, steamID.ToUInt64(), appID));
 }
예제 #4
0
파일: User.cs 프로젝트: conankzhang/fez
        public bool InitiateClientAuthentication(out byte[] authTicket, SteamID steamIDServer, IPAddress ipServer, ushort serverPort, bool isSecure)
        {
            byte[] addressBytes = ipServer.GetAddressBytes();

            this._serverIP   = (uint)((int)addressBytes[0] << 24 | (int)addressBytes[1] << 16 | (int)addressBytes[2] << 8) | (uint)addressBytes[3];
            this._serverPort = serverPort;
            byte[] authTicket1 = new byte[2048];
            int    length      = User.SteamUnityAPI_SteamUser_InitiateGameConnection(this._user, authTicket1, 2048, steamIDServer.ToUInt64(), this._serverIP, this._serverPort, isSecure);

            if (length > 0)
            {
                authTicket = new byte[length];
                for (int index = 0; index < length; ++index)
                {
                    authTicket[index] = authTicket1[index];
                }
                return(true);
            }
            else
            {
                authTicket = (byte[])null;
                return(false);
            }
        }
예제 #5
0
파일: Networking.cs 프로젝트: Zeludon/FEZ
 public void SendP2PPacket(SteamID steamID, byte[] data, EP2PSend sendType, int channel = 0)
 {
   IntPtr num = Marshal.AllocHGlobal(data.Length);
   Marshal.Copy(data, 0, num, data.Length);
   Networking.SteamUnityAPI_SteamNetworking_SendP2PPacket(this._networking, steamID.ToUInt64(), num, (uint) data.Length, (byte) sendType, channel);
   Marshal.FreeHGlobal(num);
 }
예제 #6
0
        public void ClientDisconnected(SteamID steamIDClient)
        {
            bool flag = false;

            foreach (SteamID steamId in this._playersPendingAuth)
            {
                if (steamId == steamIDClient)
                {
                    GameServer.SteamUnityAPI_SteamGameServer_SendUserDisconnect(this._gameServer, steamIDClient.ToUInt64());
                    flag = true;
                    break;
                }
            }
            if (!flag)
            {
                foreach (SteamID steamId in this._playersConnected)
                {
                    if (steamId == steamIDClient)
                    {
                        GameServer.SteamUnityAPI_SteamGameServer_SendUserDisconnect(this._gameServer, steamIDClient.ToUInt64());
                        flag = true;
                        break;
                    }
                }
            }
            if (!flag)
            {
                foreach (SteamID steamId in this._botsConnected)
                {
                    if (steamId == steamIDClient)
                    {
                        GameServer.SteamUnityAPI_SteamGameServer_SendUserDisconnect(this._gameServer, steamIDClient.ToUInt64());
                        break;
                    }
                }
            }
            this._playersPendingAuth.Remove(steamIDClient);
            this._playersConnected.Remove(steamIDClient);
            this._botsConnected.Remove(steamIDClient);
        }
예제 #7
0
파일: User.cs 프로젝트: Zeludon/FEZ
 public EUserHasLicenseForAppResult UserHasLicenseForApp(SteamID steamID, uint appID)
 {
   return User.SteamUnityAPI_SteamUser_UserHasLicenseForApp(this._user, steamID.ToUInt64(), appID);
 }
예제 #8
0
 public void CloseP2PSession(SteamID steamID, int channel)
 {
     Networking.SteamUnityAPI_SteamNetworking_CloseP2PChannel(this._networking, steamID.ToUInt64(), channel);
 }
예제 #9
0
 internal EPersonaState GetFriendPersonaState(SteamID steamIDFriend)
 {
     return((EPersonaState)Friends.SteamUnityAPI_SteamFriends_GetFriendPersonaState(this._friends, steamIDFriend.ToUInt64()));
 }
예제 #10
0
 internal string GetFriendPersonaName(SteamID steamIDFriend)
 {
     return(Friends.SteamUnityAPI_SteamFriends_GetFriendPersonaName(this._friends, steamIDFriend.ToUInt64()));
 }
예제 #11
0
 public void ActivateGameOverlayToUser(string dialog, SteamID user)
 {
     Friends.SteamUnityAPI_SteamFriends_ActivateGameOverlayToUser(dialog, user.ToUInt64());
 }
예제 #12
0
        internal Image GetLargeFriendAvatar(SteamID steamIDFriend, OnLargeAvatarReceived largeAvatarReceivedCallback)
        {
            this._largeAvatarReceivedCallback = largeAvatarReceivedCallback;
            if (this._internalOnLargeAvatarReceived == null)
            {
                this._internalOnLargeAvatarReceived = new OnLargeAvatarReceivedFromSteam(this.InternalOnLargeAvatarReceived);
            }
            int largeFriendAvatar = Friends.SteamUnityAPI_SteamFriends_GetLargeFriendAvatar(this._friends, steamIDFriend.ToUInt64(), Marshal.GetFunctionPointerForDelegate((Delegate)this._internalOnLargeAvatarReceived));

            if (largeFriendAvatar == -1)
            {
                return((Image)null);
            }
            Image avatar = new Image(largeFriendAvatar);

            if (this._largeAvatarReceivedCallback != null)
            {
                this._largeAvatarReceivedCallback(steamIDFriend, avatar);
            }
            return(avatar);
        }
예제 #13
0
 public void JoinLobby(SteamID steamIDLobby, OnLobbyJoined onLobbyJoined)
 {
     if (this._lobbyJoined != null)
     {
         this.LeaveLobby();
     }
     foreach (Lobby lobby in this._lobbyList)
     {
         if (lobby.SteamID == steamIDLobby)
         {
             this._lobbyJoined = lobby;
             break;
         }
     }
     this._onLobbyJoined = onLobbyJoined;
     CommunityExpress.Instance.AddLobbyJoinedCallback(Matchmaking.SteamUnityAPI_SteamMatchmaking_JoinLobby(this._matchmaking, steamIDLobby.ToUInt64()), new OnMatchmakingLobbyJoinedFromSteam(this.OnLobbyJoinedCallback));
 }
예제 #14
0
파일: Groups.cs 프로젝트: conankzhang/fez
 internal string GetClanTag(SteamID steamIDClan)
 {
     return(Groups.SteamUnityAPI_SteamFriends_GetClanTag(this._friends, steamIDClan.ToUInt64()));
 }
예제 #15
0
파일: Groups.cs 프로젝트: conankzhang/fez
 internal string GetGroupName(SteamID steamIDGroup)
 {
     return(Groups.SteamUnityAPI_SteamFriends_GetClanName(this._friends, steamIDGroup.ToUInt64()));
 }
예제 #16
0
        internal Image GetSmallFriendAvatar(SteamID steamIDFriend)
        {
            int smallFriendAvatar = Friends.SteamUnityAPI_SteamFriends_GetSmallFriendAvatar(this._friends, steamIDFriend.ToUInt64());

            if (smallFriendAvatar != -1)
            {
                return(new Image(smallFriendAvatar));
            }
            else
            {
                return((Image)null);
            }
        }
예제 #17
0
 public void CloseP2PSession(SteamID steamID)
 {
     Networking.SteamUnityAPI_SteamNetworking_CloseP2PSession(this._networking, steamID.ToUInt64());
 }
예제 #18
0
파일: Networking.cs 프로젝트: Zeludon/FEZ
 public void CloseP2PSession(SteamID steamID)
 {
   Networking.SteamUnityAPI_SteamNetworking_CloseP2PSession(this._networking, steamID.ToUInt64());
 }
예제 #19
0
 public void SendP2PPacket(SteamID steamID, string data, EP2PSend sendType, int channel = 0)
 {
     Networking.SteamUnityAPI_SteamNetworking_SendP2PPacket(this._networking, steamID.ToUInt64(), Marshal.StringToHGlobalAnsi(data), (uint)data.Length, (byte)sendType, channel);
 }
예제 #20
0
파일: Networking.cs 프로젝트: Zeludon/FEZ
 public void CloseP2PSession(SteamID steamID, int channel)
 {
   Networking.SteamUnityAPI_SteamNetworking_CloseP2PChannel(this._networking, steamID.ToUInt64(), channel);
 }
예제 #21
0
파일: User.cs 프로젝트: Zeludon/FEZ
 public bool InitiateClientAuthentication(out byte[] authTicket, SteamID steamIDServer, IPAddress ipServer, ushort serverPort, bool isSecure)
 {
   byte[] addressBytes = ipServer.GetAddressBytes();
   this._serverIP = (uint) ((int) addressBytes[0] << 24 | (int) addressBytes[1] << 16 | (int) addressBytes[2] << 8) | (uint) addressBytes[3];
   this._serverPort = serverPort;
   byte[] authTicket1 = new byte[2048];
   int length = User.SteamUnityAPI_SteamUser_InitiateGameConnection(this._user, authTicket1, 2048, steamIDServer.ToUInt64(), this._serverIP, this._serverPort, isSecure);
   if (length > 0)
   {
     authTicket = new byte[length];
     for (int index = 0; index < length; ++index)
       authTicket[index] = authTicket1[index];
     return true;
   }
   else
   {
     authTicket = (byte[]) null;
     return false;
   }
 }
예제 #22
0
파일: Networking.cs 프로젝트: Zeludon/FEZ
 public void SendP2PPacket(SteamID steamID, string data, EP2PSend sendType, int channel = 0)
 {
   Networking.SteamUnityAPI_SteamNetworking_SendP2PPacket(this._networking, steamID.ToUInt64(), Marshal.StringToHGlobalAnsi(data), (uint) data.Length, (byte) sendType, channel);
 }
예제 #23
0
파일: User.cs 프로젝트: Zeludon/FEZ
 public void AdvertiseGame(SteamID gameServerSteamID, IPAddress ip, ushort port)
 {
   byte[] addressBytes = ip.GetAddressBytes();
   uint serverIP = (uint) ((int) addressBytes[0] << 24 | (int) addressBytes[1] << 16 | (int) addressBytes[2] << 8) | (uint) addressBytes[3];
   User.SteamUnityAPI_SteamUser_AdvertiseGame(this._user, gameServerSteamID.ToUInt64(), serverIP, port);
 }
예제 #24
0
 public bool UpdateUserDetails(SteamID steamID, string displayableName, uint score)
 {
     return(GameServer.SteamUnityAPI_SteamGameServer_UpdateUserData(this._gameServer, steamID.ToUInt64(), displayableName, score));
 }