/// <summary> /// 通知同场景的其他玩家 我离开了 /// </summary> /// <param name="otherRole"></param> /// <param name="levalRoleId"></param> private void SendToOtherRole_RoleLeave(Role otherRole, int levalRoleId) { WorldMap_OtherRoleLeaveProto proto = new WorldMap_OtherRoleLeaveProto(); proto.RoleId = levalRoleId; otherRole.Client_Socket.SendMsg(proto.ToArray(otherRole.SocketSendMS)); }
public static WorldMap_OtherRoleLeaveProto GetProto(byte[] buffer, bool isChild = false) { WorldMap_OtherRoleLeaveProto proto = new WorldMap_OtherRoleLeaveProto(); MMO_MemoryStream ms = null; if (!isChild) { ms = GameEntry.Socket.SocketSendMS; } else { ms = GameEntry.Pool.DequeueClassObject <MMO_MemoryStream>(); } ms.SetLength(0); ms.Write(buffer, 0, buffer.Length); ms.Position = 0; proto.RoleId = ms.ReadInt(); if (isChild) { GameEntry.Pool.EnqueueClassObject(ms); } return(proto); }
public static WorldMap_OtherRoleLeaveProto GetProto(byte[] buffer) { WorldMap_OtherRoleLeaveProto proto = new WorldMap_OtherRoleLeaveProto(); using (MMO_MemoryStream ms = new MMO_MemoryStream(buffer)) { proto.RoleId = ms.ReadInt(); } return(proto); }
public static WorldMap_OtherRoleLeaveProto GetProto(MMO_MemoryStream ms, byte[] buffer) { WorldMap_OtherRoleLeaveProto proto = new WorldMap_OtherRoleLeaveProto(); ms.SetLength(0); ms.Write(buffer, 0, buffer.Length); ms.Position = 0; proto.RoleId = ms.ReadInt(); return(proto); }