mirror of
https://github.com/whoahq/whoa.git
synced 2026-03-18 05:31:07 +03:00
Compare commits
4 Commits
c511e0733b
...
30b95e16ed
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
30b95e16ed | ||
|
|
abf2e2cde3 | ||
|
|
6b7abe3c03 | ||
|
|
c12a79d6e6 |
@ -84,6 +84,26 @@ CONSOLELINE::~CONSOLELINE() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CONSOLELINE::Backspace() {
|
||||||
|
if (this->inputpos > this->inputstart) {
|
||||||
|
if (this->chars <= this->inputpos) {
|
||||||
|
this->buffer[this->inputpos - 1] = '\0';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
memcpy(
|
||||||
|
&this->buffer[this->inputpos - 1],
|
||||||
|
&this->buffer[this->inputpos],
|
||||||
|
this->chars - this->inputpos + 1
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
this->inputpos--;
|
||||||
|
this->chars--;
|
||||||
|
|
||||||
|
SetInputString(this->buffer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void DrawBackground() {
|
void DrawBackground() {
|
||||||
uint16_t indices[] = {
|
uint16_t indices[] = {
|
||||||
0, 1, 2, 3
|
0, 1, 2, 3
|
||||||
|
|||||||
@ -19,6 +19,7 @@ class CONSOLELINE : public TSLinkedNode<CONSOLELINE> {
|
|||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
~CONSOLELINE();
|
~CONSOLELINE();
|
||||||
|
void Backspace();
|
||||||
};
|
};
|
||||||
|
|
||||||
void ConsoleScreenAnimate(float elapsedSec);
|
void ConsoleScreenAnimate(float elapsedSec);
|
||||||
|
|||||||
@ -393,6 +393,11 @@ int32_t CGlueMgr::Idle(const void* a1, void* a2) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case IDLE_CREATE_CHARACTER: {
|
||||||
|
CGlueMgr::PollCreateCharacter(msg, complete, result);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case IDLE_DELETE_CHARACTER: {
|
case IDLE_DELETE_CHARACTER: {
|
||||||
CGlueMgr::PollDeleteCharacter(msg, complete, result);
|
CGlueMgr::PollDeleteCharacter(msg, complete, result);
|
||||||
break;
|
break;
|
||||||
@ -763,6 +768,37 @@ void CGlueMgr::PollCharacterList(const char* msg, int32_t complete, int32_t resu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CGlueMgr::PollCreateCharacter(const char* msg, int32_t complete, int32_t result) {
|
||||||
|
FrameScript_SignalEvent(UPDATE_STATUS_DIALOG, "%s", msg);
|
||||||
|
|
||||||
|
if (CGlueMgr::HandleBattlenetDisconnect()) {
|
||||||
|
CGlueMgr::SetIdleState(IDLE_NONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!complete) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Error
|
||||||
|
|
||||||
|
if (result == 0) {
|
||||||
|
FrameScript_SignalEvent(OPEN_STATUS_DIALOG, "%s%s", "OKAY", msg);
|
||||||
|
|
||||||
|
CGlueMgr::SetIdleState(IDLE_NONE);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Success
|
||||||
|
|
||||||
|
CGlueMgr::SetIdleState(IDLE_NONE);
|
||||||
|
|
||||||
|
FrameScript_SignalEvent(CLOSE_STATUS_DIALOG, nullptr);
|
||||||
|
FrameScript_SignalEvent(SELECT_LAST_CHARACTER, nullptr);
|
||||||
|
|
||||||
|
CGlueMgr::SetScreen("charselect");
|
||||||
|
}
|
||||||
|
|
||||||
void CGlueMgr::PollDeleteCharacter(const char* msg, int32_t complete, int32_t result) {
|
void CGlueMgr::PollDeleteCharacter(const char* msg, int32_t complete, int32_t result) {
|
||||||
FrameScript_SignalEvent(UPDATE_STATUS_DIALOG, "%s", msg);
|
FrameScript_SignalEvent(UPDATE_STATUS_DIALOG, "%s", msg);
|
||||||
|
|
||||||
|
|||||||
@ -80,6 +80,7 @@ class CGlueMgr {
|
|||||||
static int32_t OnKickReasonMsg(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg);
|
static int32_t OnKickReasonMsg(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg);
|
||||||
static void PollAccountLogin(int32_t errorCode, const char* msg, int32_t complete, int32_t result, WOWCS_OPS op);
|
static void PollAccountLogin(int32_t errorCode, const char* msg, int32_t complete, int32_t result, WOWCS_OPS op);
|
||||||
static void PollCharacterList(const char* msg, int32_t complete, int32_t result, int32_t errorCode);
|
static void PollCharacterList(const char* msg, int32_t complete, int32_t result, int32_t errorCode);
|
||||||
|
static void PollCreateCharacter(const char* msg, int32_t complete, int32_t result);
|
||||||
static void PollDeleteCharacter(const char* msg, int32_t complete, int32_t result);
|
static void PollDeleteCharacter(const char* msg, int32_t complete, int32_t result);
|
||||||
static void PollEnterWorld();
|
static void PollEnterWorld();
|
||||||
static void PollLoginServerLogin();
|
static void PollLoginServerLogin();
|
||||||
|
|||||||
@ -104,6 +104,10 @@ void ClientConnection::GetRealmList() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ClientConnection::HandleCharacterCreate(uint8_t result) {
|
||||||
|
this->Complete(result == 47, result);
|
||||||
|
}
|
||||||
|
|
||||||
void ClientConnection::HandleCharacterDelete(uint8_t result) {
|
void ClientConnection::HandleCharacterDelete(uint8_t result) {
|
||||||
this->Complete(result == 71, result);
|
this->Complete(result == 71, result);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,6 +22,7 @@ class ClientConnection : public RealmConnection {
|
|||||||
|
|
||||||
// Virtual member functions
|
// Virtual member functions
|
||||||
virtual int32_t HandleConnect();
|
virtual int32_t HandleConnect();
|
||||||
|
virtual void HandleCharacterCreate(uint8_t result);
|
||||||
virtual void HandleCharacterDelete(uint8_t result);
|
virtual void HandleCharacterDelete(uint8_t result);
|
||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
|
|||||||
@ -20,7 +20,7 @@ int32_t RealmConnection::MessageHandler(void* param, NETMESSAGE msgId, uint32_t
|
|||||||
}
|
}
|
||||||
|
|
||||||
case SMSG_CHAR_CREATE: {
|
case SMSG_CHAR_CREATE: {
|
||||||
// TODO
|
result = connection->CreateCharHandler(msgId, time, msg);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -294,6 +294,15 @@ int32_t RealmConnection::HandleCharEnum(uint32_t msgId, uint32_t time, CDataStor
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int32_t RealmConnection::CreateCharHandler(uint32_t msgId, uint32_t time, CDataStore* msg) {
|
||||||
|
uint8_t result;
|
||||||
|
msg->Get(result);
|
||||||
|
|
||||||
|
this->HandleCharacterCreate(result);
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
int32_t RealmConnection::DeleteCharHandler(uint32_t msgId, uint32_t time, CDataStore* msg) {
|
int32_t RealmConnection::DeleteCharHandler(uint32_t msgId, uint32_t time, CDataStore* msg) {
|
||||||
uint8_t result;
|
uint8_t result;
|
||||||
msg->Get(result);
|
msg->Get(result);
|
||||||
|
|||||||
@ -46,12 +46,14 @@ class RealmConnection : public NetClient {
|
|||||||
|
|
||||||
// Virtual member functions
|
// Virtual member functions
|
||||||
virtual int32_t HandleAuthChallenge(AuthenticationChallenge* challenge);
|
virtual int32_t HandleAuthChallenge(AuthenticationChallenge* challenge);
|
||||||
|
virtual void HandleCharacterCreate(uint8_t result) = 0;
|
||||||
virtual void HandleCharacterDelete(uint8_t result) = 0;
|
virtual void HandleCharacterDelete(uint8_t result) = 0;
|
||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
RealmConnection(RealmResponse* realmResponse);
|
RealmConnection(RealmResponse* realmResponse);
|
||||||
int32_t HandleAuthResponse(uint32_t msgId, uint32_t time, CDataStore* msg);
|
int32_t HandleAuthResponse(uint32_t msgId, uint32_t time, CDataStore* msg);
|
||||||
int32_t HandleCharEnum(uint32_t msgId, uint32_t time, CDataStore* msg);
|
int32_t HandleCharEnum(uint32_t msgId, uint32_t time, CDataStore* msg);
|
||||||
|
int32_t CreateCharHandler(uint32_t msgId, uint32_t time, CDataStore* msg);
|
||||||
int32_t DeleteCharHandler(uint32_t msgId, uint32_t time, CDataStore* msg);
|
int32_t DeleteCharHandler(uint32_t msgId, uint32_t time, CDataStore* msg);
|
||||||
void RequestCharacterEnum();
|
void RequestCharacterEnum();
|
||||||
void RequestCharacterLogin(uint64_t guid, int32_t a2);
|
void RequestCharacterLogin(uint64_t guid, int32_t a2);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user