예제 #1
0
 //Called from PlayerStatusWorker
 public void SendPlayerStatus(PlayerStatus playerStatus)
 {
     byte[] messageBytes;
     using (MessageWriter mw = new MessageWriter())
     {
         mw.Write<string>(playerStatus.playerName);
         mw.Write<string>(playerStatus.vesselText);
         mw.Write<string>(playerStatus.statusText);
         messageBytes = mw.GetMessageBytes();
     }
     ClientMessage newMessage = new ClientMessage();
     newMessage.type = ClientMessageType.PLAYER_STATUS;
     newMessage.data = messageBytes;
     QueueOutgoingMessage(newMessage, true);
 }
예제 #2
0
 private void HandlePlayerStatus(byte[] messageData)
 {
     using (MessageReader mr = new MessageReader(messageData, false))
     {
         string playerName = mr.Read<string>();
         string vesselText = mr.Read<string>();
         string statusText = mr.Read<string>();
         PlayerStatus newStatus = new PlayerStatus();
         newStatus.playerName = playerName;
         newStatus.vesselText = vesselText;
         newStatus.statusText = statusText;
         PlayerStatusWorker.fetch.AddPlayerStatus(newStatus);
     }
 }
예제 #3
0
 public void AddPlayerStatus(PlayerStatus playerStatus)
 {
     addStatusQueue.Enqueue(playerStatus);
 }
예제 #4
0
 public PlayerStatusWorker()
 {
     myPlayerStatus = new PlayerStatus();
     myPlayerStatus.playerName = Settings.fetch.playerName;
     myPlayerStatus.statusText = "Syncing";
 }
예제 #5
0
 private void DrawPlayerEntry(PlayerStatus playerStatus)
 {
     if (playerStatus == null)
     {
         //Just connected or disconnected.
         return;
     }
     GUILayout.BeginHorizontal();
     if (!playerNameStyle.ContainsKey(playerStatus.playerName))
     {
         playerNameStyle[playerStatus.playerName] = new GUIStyle(GUI.skin.label);
         playerNameStyle[playerStatus.playerName].normal.textColor = PlayerColorWorker.fetch.GetPlayerColor(playerStatus.playerName);
         playerNameStyle[playerStatus.playerName].hover.textColor = PlayerColorWorker.fetch.GetPlayerColor(playerStatus.playerName);
         playerNameStyle[playerStatus.playerName].active.textColor = PlayerColorWorker.fetch.GetPlayerColor(playerStatus.playerName);
         playerNameStyle[playerStatus.playerName].fontStyle = FontStyle.Bold;
         playerNameStyle[playerStatus.playerName].stretchWidth = true;
         playerNameStyle[playerStatus.playerName].wordWrap = false;
     }
     GUILayout.Label(playerStatus.playerName, playerNameStyle[playerStatus.playerName]);
     GUILayout.FlexibleSpace();
     GUILayout.Label(playerStatus.statusText, stateTextStyle);
     GUILayout.EndHorizontal();
     if (playerStatus.vesselText != "")
     {
         GUILayout.Label("Pilot: " + playerStatus.vesselText, vesselNameStyle);
     }
 }
예제 #6
0
 private void DrawPlayerEntry(PlayerStatus playerStatus)
 {
     if (playerStatus == null)
     {
         //Just connected or disconnected.
         return;
     }
     GUILayout.BeginHorizontal();
     GUILayout.Label(playerStatus.playerName, playerNameStyle);
     GUILayout.FlexibleSpace();
     GUILayout.Label(playerStatus.statusText, stateTextStyle);
     GUILayout.EndHorizontal();
     if (playerStatus.vesselText != "")
     {
         GUILayout.Label("Pilot: " + playerStatus.vesselText, vesselNameStyle);
     }
 }