Example #1
0
		internal static void Add(ModPlayer player)
		{
			string mod = player.mod.Name;
			if (!indexes.ContainsKey(mod))
			{
				indexes[mod] = new Dictionary<string, int>();
			}
			indexes[mod][player.Name] = players.Count;
			players.Add(player);
		}
Example #2
0
 private static bool SendCustomBiomes(ModPlayer modPlayer, BinaryWriter writer)
 {
     byte[] data;
     using (MemoryStream stream = new MemoryStream())
     {
         using (BinaryWriter customWriter = new BinaryWriter(stream))
         {
             modPlayer.SendCustomBiomes(customWriter);
             customWriter.Flush();
             data = stream.ToArray();
         }
     }
     if (data.Length > 0)
     {
         writer.Write(modPlayer.mod.Name);
         writer.Write(modPlayer.Name);
         writer.Write((byte)data.Length);
         writer.Write(data);
         return true;
     }
     return false;
 }
Example #3
0
 internal static void Add(ModPlayer player)
 {
     indexes[player.mod.Name + ':' + player.Name] = players.Count;
     players.Add(player);
 }
Example #4
0
 public void AddPlayer(string name, ModPlayer player)
 {
     player.Name = name;
     players[name] = player;
     player.mod = this;
     PlayerHooks.Add(player);
 }
Example #5
0
 public bool TypeEquals(ModPlayer other)
 {
     return mod == other.mod && Name == other.Name;
 }
Example #6
0
 public virtual void clientClone(ModPlayer clientClone)
 {
 }
Example #7
0
 public virtual void SendClientChanges(ModPlayer clientPlayer)
 {
 }
Example #8
0
		public void AddPlayer(string name, ModPlayer player)
		{
			Type itemClass = typeof(Item);
			Type intClass = typeof(int);
			if (player.GetType().GetMethod("CatchFish", new Type[] {
				itemClass, itemClass, intClass, intClass, intClass, intClass,
				intClass.MakeByRefType(), typeof(bool).MakeByRefType() }) != null)
			{
				throw new OldHookException("ModPlayer.CatchFish");
			}
			player.Name = name;
			players[name] = player;
			player.mod = this;
			PlayerHooks.Add(player);
		}