Exemplo n.º 1
0
 public static void Exit(Player.Player playr)
 {
     _ChatMsg -= new OnChat(playr.OnCustomSpeak);
     Player.Player outp;
     if (!Players.TryRemove(playr.Identity.UsernameLower, out outp))
     {
         Log.LogException(new Exception(), "Failed to remove player from world " + playr.Identity.UsernameLower);
     }
 }
Exemplo n.º 2
0
 public static void Enter(Player.Player playr)
 {
     if (Players.TryAdd(playr.Identity.UsernameLower, playr))
     {
         _ChatMsg += new OnChat(playr.OnCustomSpeak);
         Map outm;
         if (World.GetMap(playr.Position.CurMap.Name) == null)
         {
             playr.Position.CurMap.Name = "Rest";
             playr.Position.X           = 15;
             playr.Position.Y           = 15;
         }
         if (Maps.TryGetValue(playr.Position.CurMap.Name, out outm))
         {
             outm.Enter(playr);
         }
     }
 }
Exemplo n.º 3
0
 protected void OnOsChat(object sender, OSChatMessage chat)
 {
     if (OnChat != null)
     {
         foreach (OnChatDelegate d in OnChat.GetInvocationList())
         {
             try
             {
                 d(chat);
             }
             catch (Exception e)
             {
                 m_log.ErrorFormat(
                     "[WATER WARS]: Delegate for OnOsChat failed - continuing.  {0}{1}",
                     e.Message, e.StackTrace);
             }
         }
     }
 }
Exemplo n.º 4
0
 private void TriggerChatChanged(ChatEntry entry)
 {
     OnChat?.Invoke(entry.Coach, entry.Source, entry.Text);
 }