예제 #1
0
        private 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( "Maps\\JigsawPuzzleGame\\PutToDestinationPlace.ogg" );
            if( completePuzzle )
                ClientOrSingle_SoundPlay( "Maps\\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
            public Client_Player( uint identifier, string name, bool bot,
				UserManagementClientNetworkService.UserInfo user )
            {
                this.identifier = identifier;
                this.name = name;
                this.bot = bot;
                this.user = user;
            }