Ejemplo n.º 1
0
        public ExperimentEventServer(ServerConnection serverConnection, Action <string> actionLog = null)
        {
            this.distributionServer = serverConnection.messageDistribution;
            this.serverConnection   = serverConnection;

            distributionServer.AddListener((int)CommandID.ExperimentInfoReceipt, (senderID, data) =>
            {
                data.DeSerialize(experimentInfo, data.bytes);

                if (actionLog != null)
                {
                    actionLog("请求:ExperimentInfoReceipt");
                }
            });

            distributionServer.AddListener((int)CommandID.ExperimentInfoRequest, (senderID, data) =>
            {
                data.DeSerialize(experimentInfo, data.bytes);

                if (actionLog != null)
                {
                    actionLog("请求:ExperimentInfoRequest");
                }
            });
        }
Ejemplo n.º 2
0
 public ServerConnection()
 {
     messageDistribution = new MessageDistributionServer();
 }