private void OnLobbyCreated(RailID lobbyID) { WeGameHelper.WriteDebugString("SetLocalPeer: {0}", (object)(ulong)((RailComparableID)lobbyID).id_); this._reader.SetLocalPeer(lobbyID); this._writer.SetLocalPeer(lobbyID); this._serverID = lobbyID; Action action = (Action)(() => { // ISSUE: explicit non-virtual call ReportServerID t = new ReportServerID() { _serverID = (((RailComparableID)lobbyID).id_.ToString()) }; IPCMessage msg = new IPCMessage(); msg.Build <ReportServerID>(IPCMessageType.IPCMessageTypeReportServerID, t); WeGameHelper.WriteDebugString("Send serverID to game client - " + this._client.SendMessage(msg).ToString()); }); if (this._serverConnected) { action(); } else { this._ipcConnetedAction += action; WeGameHelper.WriteDebugString("report server id fail, no connection"); } }
private void OnLobbyCreated(RailID lobbyID) { WeGameHelper.WriteDebugString("SetLocalPeer: {0}", ((RailComparableID)lobbyID).id_); _reader.SetLocalPeer(lobbyID); _writer.SetLocalPeer(lobbyID); _serverID = lobbyID; Action action = delegate { ReportServerID t = new ReportServerID { _serverID = ((RailComparableID)lobbyID).id_.ToString() }; IPCMessage iPCMessage = new IPCMessage(); iPCMessage.Build(IPCMessageType.IPCMessageTypeReportServerID, t); WeGameHelper.WriteDebugString("Send serverID to game client - " + _client.SendMessage(iPCMessage)); }; if (_serverConnected) { action(); return; } _ipcConnetedAction = (Action)Delegate.Combine(_ipcConnetedAction, action); WeGameHelper.WriteDebugString("report server id fail, no connection"); }
private bool SendFriendListToLocalServer() { bool result = false; if (_hasLocalHost) { List <RailFriendInfo> list = new List <RailFriendInfo>(); if (GetRailFriendList(list)) { WeGameFriendListInfo t = new WeGameFriendListInfo { _friendList = list }; IPCMessage iPCMessage = new IPCMessage(); iPCMessage.Build(IPCMessageType.IPCMessageTypeNotifyFriendList, t); result = _msgServer.SendMessage(iPCMessage); WeGameHelper.WriteDebugString("NotifyFriendListToServer: " + result.ToString()); } } return(result); }
private bool SendFriendListToLocalServer() { bool flag = false; if (this._hasLocalHost) { List <RailFriendInfo> list = new List <RailFriendInfo>(); if (this.GetRailFriendList(list)) { WeGameFriendListInfo t = new WeGameFriendListInfo() { _friendList = list }; IPCMessage msg = new IPCMessage(); msg.Build <WeGameFriendListInfo>(IPCMessageType.IPCMessageTypeNotifyFriendList, t); flag = this._msgServer.SendMessage(msg); WeGameHelper.WriteDebugString("NotifyFriendListToServer: " + flag.ToString()); } } return(flag); }