void OnGetBlocks(Client peer, C_Scene_GetBlocks_0x0306 msg) { Singleton._log.Info("C_Scene_GetBlocks_0x0306" + ", client=" + peer._accountName); int id = Singleton._sceneManager.GetSceneID(peer._accountName); if (id < 0) { return; } var s = Singleton._sceneManager.GetScene(id); if (s == null) { return; } var rs = Singleton._sceneManager.GetBlocks(id); if (rs == null) { return; } Singleton._log.Info("S_Scene_GetBlocks_0x0306" + ", client=" + peer._accountName); Send(peer, new S_Scene_GetBlocks_0x0306 { _data = rs, _width = s._width, _height = s._height }); }
public void GetBlocks(Action <BlockData[]> action) { Debug.Log("[C_Scene_GetBlocks_0x0306]"); _onGetBlocks = action; var data = new C_Scene_GetBlocks_0x0306(); Singleton._serverCallback.AddCallback <S_Scene_GetBlocks_0x0306>(OnGetBlocks); Singleton._messageManager.Send(data); }