mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-22 13:30:06 +00:00
Compare commits
No commits in common. "225515ec216ee1cbc3e863fed9a2c6ba5a6ed8e4" and "1781ac6b03eae6673dcefee6f6547e2ad8270ae8" have entirely different histories.
225515ec21
...
1781ac6b03
@ -155,7 +155,7 @@ void PlayerManager::sendPlayerTo(CNSocket* sock, int X, int Y, int Z) {
|
|||||||
* Nanos the player hasn't unlocked will (and should) be greyed out. Thus, all nanos should be accounted
|
* Nanos the player hasn't unlocked will (and should) be greyed out. Thus, all nanos should be accounted
|
||||||
* for in these packets, even if the player hasn't unlocked them.
|
* for in these packets, even if the player hasn't unlocked them.
|
||||||
*/
|
*/
|
||||||
static void sendNanoBook(CNSocket *sock, Player *plr, bool resizeOnly) {
|
static void sendNanoBookSubset(CNSocket *sock, Player *plr) {
|
||||||
#ifdef ACADEMY
|
#ifdef ACADEMY
|
||||||
int16_t id = 0;
|
int16_t id = 0;
|
||||||
INITSTRUCT(sP_FE2CL_REP_NANO_BOOK_SUBSET, pkt);
|
INITSTRUCT(sP_FE2CL_REP_NANO_BOOK_SUBSET, pkt);
|
||||||
@ -163,13 +163,6 @@ static void sendNanoBook(CNSocket *sock, Player *plr, bool resizeOnly) {
|
|||||||
pkt.PCUID = plr->iID;
|
pkt.PCUID = plr->iID;
|
||||||
pkt.bookSize = NANO_COUNT;
|
pkt.bookSize = NANO_COUNT;
|
||||||
|
|
||||||
if (resizeOnly) {
|
|
||||||
// triggers nano array resizing without
|
|
||||||
// actually sending nanos
|
|
||||||
sock->sendPacket(pkt, P_FE2CL_REP_NANO_BOOK_SUBSET);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (id < NANO_COUNT) {
|
while (id < NANO_COUNT) {
|
||||||
pkt.elementOffset = id;
|
pkt.elementOffset = id;
|
||||||
|
|
||||||
@ -299,14 +292,14 @@ static void enterPlayer(CNSocket* sock, CNPacketData* data) {
|
|||||||
sock->setFEKey(lm->FEKey);
|
sock->setFEKey(lm->FEKey);
|
||||||
sock->setActiveKey(SOCKETKEY_FE); // send all packets using the FE key from now on
|
sock->setActiveKey(SOCKETKEY_FE); // send all packets using the FE key from now on
|
||||||
|
|
||||||
// Academy builds receive nanos in a separate packet. An initial one with the size of the
|
// Academy builds receive nanos in a separate packet. These need to be sent
|
||||||
// nano book needs to be sent before PC_ENTER_SUCC so the client can resize its nano arrays,
|
// before P_FE2CL_REP_PC_ENTER_SUCC as well as after
|
||||||
// and then proper packets with the nanos included must be sent after, while the game is loading.
|
// due to a race condition in the client :(
|
||||||
sendNanoBook(sock, plr, true);
|
sendNanoBookSubset(sock, plr);
|
||||||
|
|
||||||
sock->sendPacket(response, P_FE2CL_REP_PC_ENTER_SUCC);
|
sock->sendPacket(response, P_FE2CL_REP_PC_ENTER_SUCC);
|
||||||
|
|
||||||
sendNanoBook(sock, plr, false);
|
sendNanoBookSubset(sock, plr);
|
||||||
|
|
||||||
// transfer ownership of Player object into the shard (still valid in this function though)
|
// transfer ownership of Player object into the shard (still valid in this function though)
|
||||||
addPlayer(sock, plr);
|
addPlayer(sock, plr);
|
||||||
|
Loading…
Reference in New Issue
Block a user