protected void Enter(byte[] data) { int mapId = DataPro.getInt(data, ref tempindex); Map m = MapManager.getMapOfId(mapId); if (m != null) { m_map = m; x = DataPro.getInt(data, ref tempindex); y = DataPro.getInt(data, ref tempindex); m_map.Enter(this); } }
//客户端断开链接 protected override void onDisConnection() { if (m_map != null) { //从map中移除这个玩家 m_map.Leave(this); } m_map = null; }
public static void init(int lenght) { for (int i = 0; i < lenght; i ++ ) { Map m = new Map(); m.id = i; m_stack.Push(m); } }