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); }
public void SayPrivate(string text, UserManagementClientNetworkService.UserInfo toUser) { MessageType messageType = GetMessageType("textToServer"); SendDataWriter writer = BeginMessage(messageType); writer.Write(text); writer.WriteVariableUInt32(toUser.Identifier); EndMessage(); }
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" ); }
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 ); }
public Client_Player( uint identifier, string name, bool bot, UserManagementClientNetworkService.UserInfo user ) { this.identifier = identifier; this.name = name; this.bot = bot; this.user = user; }