示例#1
0
        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");
        }
示例#3
0
 private void OnReportServerID(ReportServerID reportServerID)
 {
     WeGameHelper.WriteDebugString("OnReportServerID - " + reportServerID._serverID);
     AsyncSetMyMetaData(_serverIDMedataKey, reportServerID._serverID);
     AsyncSetInviteCommandLine(reportServerID._serverID);
 }