public static void HandleChannel(Session session, NetworkObject networkObject) { string channelName = NetworkObjectField.ReadStringField(networkObject.GetField(1)); if (string.IsNullOrWhiteSpace(channelName)) { return; } ClientChannelAction action = (ClientChannelAction)NetworkObjectField.ReadIntField(networkObject.GetField(0)); switch (action) { case ClientChannelAction.Join: { Channel channel = ChannelManager.GetChannel(channelName); channel.AddMember(session.Character); break; } case ClientChannelAction.Leave: { Channel channel = ChannelManager.GetChannel(channelName); channel?.RemoveMember(session.Character); break; } case ClientChannelAction.Message: { Channel channel = ChannelManager.GetChannel(channelName); channel.BroadcastMessage(session.Character, NetworkObjectField.ReadStringField(networkObject.GetField(2))); break; } } }
public static void Handle08(Session session, NetworkObject networkObject) { NetworkObjectField.ReadIntField(networkObject.GetField(0)); string recipient = NetworkObjectField.ReadStringField(networkObject.GetField(1)); string message = NetworkObjectField.ReadStringField(networkObject.GetField(2)); ConversationManager.SendMessage(session, recipient, message); }
public override void FromNetworkObject(NetworkObject networkObject) { Server = NetworkObjectField.ReadStringField(networkObject.GetField(0)); Name = NetworkObjectField.ReadStringField(networkObject.GetField(1)); Guid = (uint)NetworkObjectField.ReadIntField(networkObject.GetField(2)); Sequence = (uint)NetworkObjectField.ReadLongField(networkObject.GetField(3)); Unknown1 = NetworkObjectField.ReadStringField(networkObject.GetField(4)); Unknown1 = Name; // ?? }
public static void Handle0C(Session session, NetworkObject networkObject) { int action = NetworkObjectField.ReadIntField(networkObject.GetField(0)); switch (action) { case 7: { break; } case 9: { ushort landblockId = NetworkObjectField.ReadUShortField(networkObject.GetField(1)); break; } } }
public static void HandleFriendList(Session session, NetworkObject networkObject) { ClientFriendAction action = (ClientFriendAction)NetworkObjectField.ReadIntField(networkObject.GetField(0)); switch (action) { case ClientFriendAction.Create: session.FriendManager.AddAccountAll(NetworkObjectField.ReadStringField(networkObject.GetField(1))); break; case ClientFriendAction.Remove: session.FriendManager.RemoveAccountAll(NetworkObjectField.ReadStringField(networkObject.GetField(1))); break; default: log.Warn($"[{session.Account.Username}] Invalid FriendAction {action}!"); break; } }
public static void HandleFellowship(Session session, NetworkObject networkObject) { FellowshipAction action = (FellowshipAction)NetworkObjectField.ReadIntField(networkObject.GetField(0)); FellowshipObject fellowshipInfo = new FellowshipObject(); fellowshipInfo.FromNetworkObject(networkObject.GetField(1).ReadObject()); switch (action) { case FellowshipAction.Join: { Fellowship fellowship = FellowshipManager.GetFellowship(fellowshipInfo); fellowship.AddMember(session); break; } case FellowshipAction.Leave: { Fellowship fellowship = FellowshipManager.GetFellowship(fellowshipInfo); fellowship?.RemoveMember(session); break; } } }
public override void FromNetworkObject(NetworkObject fellowship) { Name = NetworkObjectField.ReadStringField(fellowship.GetField(0)); Unknown1 = (Enum16)NetworkObjectField.ReadIntField(fellowship.GetField(1)); }
public static void HandleFellowshipMessage(Session session, NetworkObject networkObject) { int test = NetworkObjectField.ReadIntField(networkObject.GetField(0)); int tes2t = NetworkObjectField.ReadIntField(networkObject.GetField(1)); }