Exemple #1
0
        //--------------------------------------------------------------------------------------------------------------------------
        // 供外部直接调用的方法,实际执行线程是调用线程。
        //--------------------------------------------------------------------------------------------------------------------------
        internal void SaveCreateUser(AccountInfo ai, string nickname, ulong userGuid)
        {
            try {
                TableAccount dataAccount = ai.ToProto();
                Msg_LD_Save  msg         = new Msg_LD_Save();
                msg.MsgId = (int)DataEnum.TableAccount;
                msg.PrimaryKeys.Add(dataAccount.AccountId);
                msg.Data = DbDataSerializer.Encode(dataAccount);
                DispatchAction(SaveInternal, msg);

                TableNicknameInfo dataNickname = new TableNicknameInfo();
                dataNickname.Nickname = nickname;
                dataNickname.UserGuid = userGuid;
                Msg_LD_Save msgNickname = new Msg_LD_Save();
                msgNickname.MsgId = (int)DataEnum.TableNicknameInfo;
                msgNickname.PrimaryKeys.Add(dataNickname.Nickname);
                msgNickname.Data = DbDataSerializer.Encode(dataNickname);
                DispatchAction(SaveInternal, msgNickname);
            } catch (Exception e) {
                LogSys.Log(LOG_TYPE.ERROR, "DataCache Save ERROR. Msg:CreateUser, Key:{0}, Error:{1},\nStacktrace:{2}", ai.AccountId, e.Message, e.StackTrace);
            }
        }