Example #1
0
        public static void OnLogin(SessionResponse.ResponseResult error, SessionResponse response)
        {
            // 로그인 이후 처리를 담당합니다.
            Log.Info("OnLogin: session={0}, result={1}, data={2}",
                     response.session.Id, (error == SessionResponse.ResponseResult.OK ? "ok" : "failed"),
                     response.data.ToString());

            SendMyMessage(response.session, kLoginMessage, response.error_code,
                          response.error_message, response.data);
        }
Example #2
0
        public static void OnLogout(
            SessionResponse.ResponseResult error, SessionResponse response, bool caused_by_session_close)
        {
            // 로그아웃 이후 처리를 담당합니다.
            Log.Info("OnLogout: session={0}, result={1}, caused_by={2},, data={3}",
                     response.session.Id, (error == SessionResponse.ResponseResult.OK ? "ok" : "failed"),
                     (caused_by_session_close ? "session close" : "action"),
                     response.data.ToString());

            Event.EventFunction event_fn = new Event.EventFunction(() => {
                MatchmakingHelper.CancelMatchmaking(response.session);

                // 세션 닫힘 이벤트가 아니라면 로그아웃 요청으로 이 콜백을 호출한 경우므로
                // 메시지를 보냅니다.
                if (!caused_by_session_close)
                {
                    SendMyMessage(response.session, kLogoutMessage, response.error_code,
                                  response.error_message, response.data);
                }
            });
            Event.Invoke(event_fn, response.session.Id);
        }
Example #3
0
        public static void OnDedicatedServerSpawned(SessionResponse.ResponseResult error, SessionResponse response)
        {
            // 클라이언트 리다이렉션 메시지는 엔진 내부에서 이 핸들러와 별개로 처리합니다.
            // 이 곳에서는 서버 생성 결과만 메시지를 보냅니다.
            Log.Info(
                "OnDedicatedServerSpawned" +
                ": session_id={0}, error={1}, response.error_code={2}, response.error_message={3}, , response.data={4}",
                response.session.Id, (error == SessionResponse.ResponseResult.OK ? "ok" : "failed"),
                response.error_code, response.error_message, response.data.ToString());

            SendMyMessage(response.session, kMatchThenSpawnMessage,
                          response.error_code, response.error_message,
                          response.data);
        }