private static void IncomingPackets_MobileUpdatedEvent(int client, int serial, int ID, int hue, int status, int x, int y, int z, int direction) { Mobile m; if (ClientInfoCollection.GetMobile(client, serial, out m)) { m.ID = ID; m.X = x; m.Y = y; m.Z = z; m.Direction = direction; m.Hue = hue; m.Status = status; } else { ClientInfo ci; if (ClientInfoCollection.GetClient(client, out ci)) { PlayerMobile p = ci.Player; if (p != null && p.Serial == serial) { p.ID = ID; p.X = x; p.Y = y; p.Z = z; p.Direction = direction; p.Hue = hue; p.Status = status; } } } }
private static void IncomingPackets_MobileNameEvent(int client, int serial, string name) { Mobile m; if (ClientInfoCollection.GetMobile(client, serial, out m)) { m.Name = name; } }
private static void IncomingPackets_ShortStatusEvent(int client, int serial, string name, int health, int maxHealth, int sex) { Mobile m; if (ClientInfoCollection.GetMobile(client, serial, out m)) { m.Name = name; m.Health = health; m.MaxHealth = maxHealth; m.Sex = sex; } }
private static void OutgoingPackets_UseItemRequestedEvent(int client, int serial) { ClientInfo ci; if (!ClientInfoCollection.GetClient(client, out ci)) { return; } if ((serial & ~0x7FFFFFFF) != 0) { serial ^= ~0x7FFFFFFF; if (ci.Player.Serial == serial) { TreeViewUpdater.UpdateLastObject(ci.ProcessID, (WorldItem)ci.Player); return; } } if (UOMath.IsMobile(serial)) { Mobile m; if (ClientInfoCollection.GetMobile(client, serial, out m)) { TreeViewUpdater.UpdateLastObject(ci.ProcessID, (WorldItem)m); } else { Mobile newMobile = new Mobile(serial, client); newMobile.myName = "This mobile not found!"; TreeViewUpdater.UpdateLastObject(ci.ProcessID, (WorldItem)newMobile); } } else { Item i; if (ClientInfoCollection.GetItem(client, serial, out i)) { TreeViewUpdater.UpdateLastObject(ci.ProcessID, (WorldItem)i); } else { Item newItem = new Item(serial); newItem.Name = "This item not found!"; TreeViewUpdater.UpdateLastObject(ci.ProcessID, (WorldItem)newItem); } } }
private static void IncomingPackets_MobileMovingEvent(int client, int serial, int ID, int x, int y, int z, int direction, int hue, int status, int notoriety) { ClientInfo ci; if (ClientInfoCollection.GetClient(client, out ci) && ci.Player.Serial == serial) { PlayerMobile p = ci.Player; p.ID = ID; p.X = x; p.Y = y; p.Z = z; p.Direction = direction; p.Hue = hue; p.Status = status; p.Notoriety = notoriety; } else { Mobile m; if (ClientInfoCollection.GetMobile(client, serial, out m)) { m.ID = ID; m.X = x; m.Y = y; m.Z = z; m.Direction = direction; m.Hue = hue; m.Status = status; m.Notoriety = notoriety; } else { Mobile newMobile = new Mobile(serial, client); newMobile.myID = ID; newMobile.myX = x; newMobile.myY = y; newMobile.myZ = z; newMobile.myDirection = direction; newMobile.myHue = hue; newMobile.myStatus = status; newMobile.myNotoriety = notoriety; ClientInfoCollection.ClientList[client].Mobiles.Add(newMobile); } } }
/// <summary> /// Get mobile from specified client. /// </summary> /// <param name="client">Target client.</param> /// <param name="serial">Serial of mobile to retrieve.</param> /// <param name="mobile">Mobile (out).</param> /// <returns>True on success.</returns> public static bool GetMobile(int client, int serial, out Mobile mobile) { return(ClientInfoCollection.GetMobile(client, serial, out mobile)); }