private void OnEvent_OnServerHello(object param) { Msg_G2C_Hello msg_G2C_Hello = param as Msg_G2C_Hello; this.LocalActorId = msg_G2C_Hello.LocalId; Debug.Log("OnEvent_OnServerHello " + this.LocalActorId, Array.Empty <object>()); }
public void OnRecvPlayerGameData(Player player) { if (player == null || MaxPlayerCount <= player.LocalId || Players[player.LocalId] != player) { return; } bool hasRecvAll = true; foreach (var user in Players) { if (user != null && user.GameData == null) { hasRecvAll = false; break; } } var playerCount = MaxPlayerCount; if (hasRecvAll) { //TODO for (int i = 0; i < playerCount; i++) { var helloMsg = new Msg_G2C_Hello() { LocalId = (byte)i }; Players[i].SendTcp(EMsgSC.G2C_Hello, helloMsg); } var userInfos = new GameData[playerCount]; for (int i = 0; i < playerCount; i++) { userInfos[i] = Players[i]?.GameData; } //all user data ready notify game start SetStartInfo(new Msg_G2C_GameStartInfo() { MapId = MapId, RoomId = GameId, Seed = Seed, UserCount = MaxPlayerCount, TcpEnd = TcpEnd, UdpEnd = UdpEnd, SimulationSpeed = 30, UserInfos = userInfos }); } }
public virtual void OnTcpHello(Msg_G2C_Hello msg) { }
public override void OnTcpHello(Msg_G2C_Hello msg) { Log($"OnTcpHello msg:{msg} "); CoroutineHelper.StartCoroutine(YiledLoadingMap()); }
public void OnTcpHello(Msg_G2C_Hello msg) { Log($"OnTcpHello msg:{msg} "); EventHelper.Trigger(EEvent.OnGameCreate, msg); }
public void OnGameCreateHello(Msg_G2C_Hello msg) { Debug.Log("Msg_G2C_Hello ", Array.Empty <object>()); this.LocalActorId = msg.LocalId; }
public void OnServerHello(Msg_G2C_Hello msg) { this.LocalActorId = msg.LocalId; Debug.Log("OnEvent_OnServerHello " + this.LocalActorId, Array.Empty <object>()); }
public void OnTcpHello(Msg_G2C_Hello msg) { Log($"OnTcpHello msg:{msg} "); EventHelper.Trigger(EEvent.OnGameCreate, msg); //CoroutineHelper.StartCoroutine(YiledLoadingMap()); }
protected void G2C_Hello(object reader) { Msg_G2C_Hello param = reader as Msg_G2C_Hello; EventHelper.Trigger(EEvent.OnServerHello, param); }