コード例 #1
0
        bool ReceiveMessage_TextToClient(NetworkNode.ConnectedNode sender,
                                         MessageType messageType, ReceiveDataReader reader, ref string additionalErrorMessage)
        {
            //get data from message
            uint   fromUserIdentifier = reader.ReadVariableUInt32();
            string text = reader.ReadString();

            if (!reader.Complete())
            {
                return(false);
            }

            //get user by identifier
            UserManagementClientNetworkService.UserInfo fromUser = userManagementService.GetUser(
                fromUserIdentifier);
            if (fromUser == null)
            {
                //error. no such user.
                return(true);
            }

            if (ReceiveText != null)
            {
                ReceiveText(this, fromUser, text);
            }

            return(true);
        }
コード例 #2
0
        public void SayPrivate(string text, UserManagementClientNetworkService.UserInfo toUser)
        {
            MessageType    messageType = GetMessageType("textToServer");
            SendDataWriter writer      = BeginMessage(messageType);

            writer.Write(text);
            writer.WriteVariableUInt32(toUser.Identifier);
            EndMessage();
        }
コード例 #3
0
        void Client_ReceiveMoveFinish( RemoteEntityWorld sender, ReceiveDataReader reader )
        {
            bool putToDestinationPlace = reader.ReadBoolean();
            bool completePuzzle = reader.ReadBoolean();
            if( !reader.Complete() )
                return;

            client_movingByUser = null;

            //play sounds
            if( putToDestinationPlace )
                ClientOrSingle_SoundPlay( "JigsawPuzzleGame\\PutToDestinationPlace.ogg" );
            if( completePuzzle )
                ClientOrSingle_SoundPlay( "JigsawPuzzleGame\\CompletePuzzle.ogg" );
        }
コード例 #4
0
        void Client_ReceiveMoveBegin( RemoteEntityWorld sender, ReceiveDataReader reader )
        {
            uint userId = reader.ReadVariableUInt32();
            if( !reader.Complete() )
                return;

            UserManagementClientNetworkService userService = GameNetworkClient.Instance.
                UserManagementService;

            client_movingByUser = userService.GetUser( userId );
        }
コード例 #5
0
ファイル: PlayerManager.cs プロジェクト: yoda/gamedesign
            public Client_Player( uint identifier, string name, bool bot,
				UserManagementClientNetworkService.UserInfo user )
            {
                this.identifier = identifier;
                this.name = name;
                this.bot = bot;
                this.user = user;
                this.team = PlayerTeam.SpectatorPlayer; // Team default = 0 (spectator)
            }
コード例 #6
0
 public Client_Player( uint identifier, string name, bool bot,
     UserManagementClientNetworkService.UserInfo user)
 {
     this.identifier = identifier;
     this.name = name;
     this.bot = bot;
     this.user = user;
 }