Ejemplo n.º 1
0
 private void SendLine(string line)
 {
     if (BoltNetwork.isRunning)
     {
         if (line[0] == '/')
         {
             line = line.Trim(new char[]
             {
                 ' ',
                 '/'
             });
             int num = line.IndexOf(' ');
             if (num == -1)
             {
                 CoopAdminCommand.Send(line, string.Empty);
             }
             else
             {
                 CoopAdminCommand.Send(line.Substring(0, num), line.Substring(num + 1, line.Length - (num + 1)));
             }
         }
         else
         {
             ChatEvent chatEvent = ChatEvent.Create(GlobalTargets.OnlyServer);
             chatEvent.Message = line;
             chatEvent.Sender  = LocalPlayer.Entity.networkId;
             chatEvent.Send();
         }
     }
 }
Ejemplo n.º 2
0
		public void BanByConnectionId(int connectionId)
		{
			if (CoopPeerStarter.Dedicated && CoopSteamClientStarter.IsAdmin)
			{
				CoopAdminCommand.Send("banbycid", connectionId.ToString());
			}
		}
Ejemplo n.º 3
0
		public void Kick(ulong steamid)
		{
			if (CoopPeerStarter.Dedicated && CoopSteamClientStarter.IsAdmin)
			{
				CoopAdminCommand.Send("kick", steamid.ToString());
			}
			else
			{
				CoopKick.KickPlayer(steamid, 1, "HOST_KICKED_YOU");
				base.Invoke("Refresh", 0.1f);
			}
		}
Ejemplo n.º 4
0
		public void Ban(ulong steamid)
		{
			if (CoopPeerStarter.Dedicated && CoopSteamClientStarter.IsAdmin)
			{
				CoopAdminCommand.Send("ban", steamid.ToString());
			}
			else
			{
				BoltConnection connection;
				BoltEntity playerEntity;
				MpPlayerList.GetConnectionAndEntity(steamid, out connection, out playerEntity);
				CoopKick.BanPlayer(connection, playerEntity);
				base.Invoke("Refresh", 0.1f);
			}
		}
Ejemplo n.º 5
0
 public void BanByName(string name)
 {
     if (CoopPeerStarter.Dedicated && CoopSteamClientStarter.IsAdmin)
     {
         CoopAdminCommand.Send("ban", name);
     }
     else
     {
         BoltEntity entityFromName = MpPlayerList.GetEntityFromName(name, null);
         if (entityFromName)
         {
             CoopKick.BanPlayer(entityFromName);
             base.Invoke("Refresh", 0.1f);
         }
     }
 }
Ejemplo n.º 6
0
 public void Ban(ulong steamid)
 {
     if (CoopPeerStarter.Dedicated && CoopSteamClientStarter.IsAdmin)
     {
         CoopAdminCommand.Send("ban", steamid.ToString());
     }
     else
     {
         BoltEntity entityFromSteamID = MpPlayerList.GetEntityFromSteamID(steamid);
         if (entityFromSteamID)
         {
             CoopKick.BanPlayer(entityFromSteamID);
             base.Invoke("Refresh", 0.1f);
         }
     }
 }
Ejemplo n.º 7
0
 public void KickByName(string name)
 {
     if (CoopPeerStarter.Dedicated && CoopSteamClientStarter.IsAdmin)
     {
         CoopAdminCommand.Send("kick", name);
     }
     else
     {
         BoltEntity entityFromName = MpPlayerList.GetEntityFromName(name, null);
         if (entityFromName)
         {
             CoopKick.KickPlayer(entityFromName, -1, "HOST_KICKED_YOU");
             base.Invoke("Refresh", 0.1f);
         }
     }
 }
Ejemplo n.º 8
0
 public void Kick(ulong steamid)
 {
     if (CoopPeerStarter.Dedicated && CoopSteamClientStarter.IsAdmin)
     {
         CoopAdminCommand.Send("kick", steamid.ToString());
     }
     else
     {
         BoltEntity entityFromSteamID = MpPlayerList.GetEntityFromSteamID(steamid);
         if (entityFromSteamID)
         {
             CoopKick.KickPlayer(entityFromSteamID, -1, "HOST_KICKED_YOU");
             base.Invoke("Refresh", 0.1f);
         }
     }
 }