AutotrainerSipCall::AutotrainerSipCall(iCore::MsgThread &thread, iLogW::ILogSessionCreator &logCreator, boost::function<void (T *)> deleter, Utils::SafeRef<IRemoteParticipant> remoteParticipant, const Commands &commands) : iCore::MsgObject(thread), m_timer(this, &T::OnTimeout), m_log(logCreator.CreateSession(CallName(), true)), m_infoTag(m_log->RegisterRecordKind(L"Info", true)), m_deleter(deleter), m_callDeleted(false), m_commands(commands), m_remoteParticipant(remoteParticipant) { // Incoming call ESS_ASSERT(!m_commands.empty()); if (m_log->LogActive(m_infoTag)) { *m_log << m_infoTag << "Created." << iLogW::EndRecord; } m_remoteParticipant->LinkUser(this); CreateMedia(); PutMsg(this, &T::OnCommand); }
void Scene_Map::Update() { if (Game_Temp::transition_processing) { Game_Temp::transition_processing = false; Graphics::Transition(Game_Temp::transition_type, 32, Game_Temp::transition_erase); } if (auto_transition) { auto_transition = false; if (!auto_transition_erase) { // Fade Out not handled here but in StartTeleportPlayer because otherwise // emscripten hangs before fading out when doing async loading... Graphics::Transition((Graphics::TransitionType)Game_System::GetTransition(Game_System::Transition_TeleportShow), 32, false); return; } } // Async loading note: // Fade In must be done before finish teleport, otherwise chipset is not // loaded and renders black while fading -> ugly if (!Game_Map::IsTeleportDelayed() && Main_Data::game_player->IsTeleporting()) { FinishTeleportPlayer(); return; } // The delay is only needed for one frame to execute pending transitions, // the interpreters continue on the old map afterwards Game_Map::SetTeleportDelayed(false); Main_Data::game_party->UpdateTimers(); Game_Map::Update(); Main_Data::game_screen->Update(); spriteset->Update(); message_window->Update(); StartTeleportPlayer(); if (Game_Temp::gameover) { Game_Temp::gameover = false; Scene::Push(std::make_shared<Scene_Gameover>()); } if (Game_Temp::to_title) { Game_Temp::to_title = false; Scene::PopUntil(Scene::Title); } if (Game_Message::visible) return; if (Player::debug_flag) { // ESC-Menu calling can be force called when TestPlay mode is on and cancel is pressed 5 times while holding SHIFT if (Input::IsPressed(Input::SHIFT)) { if (Input::IsTriggered(Input::CANCEL)) { debug_menuoverwrite_counter++; if (debug_menuoverwrite_counter >= 5) { Game_Temp::menu_calling = true; debug_menuoverwrite_counter = 0; } } } else { debug_menuoverwrite_counter = 0; } if (Input::IsTriggered(Input::DEBUG_MENU)) { CallDebug(); } else if (Input::IsTriggered(Input::DEBUG_SAVE)) { CallSave(); } } if (!Main_Data::game_player->IsMoving()) { if (Game_Temp::menu_calling) { CallMenu(); return; } if (Game_Temp::name_calling) { CallName(); return; } if (Game_Temp::shop_calling) { CallShop(); return; } if (Game_Temp::save_calling) { CallSave(); return; } if (Game_Temp::load_calling) { CallLoad(); return; } if (Game_Temp::battle_calling) { CallBattle(); return; } } }
void Scene_Map::Update() { if (Game_Temp::transition_processing) { Game_Temp::transition_processing = false; Graphics::Transition(Game_Temp::transition_type, 32, Game_Temp::transition_erase); } if (auto_transition) { auto_transition = false; if (!auto_transition_erase) { // Fade Out not handled here but in StartTeleportPlayer because otherwise // emscripten hangs before fading out when doing async loading... Graphics::Transition((Graphics::TransitionType)Game_System::GetTransition(Game_System::Transition_TeleportShow), 32, false); return; } } // Async loading note: // Fade In must be done before finish teleport, otherwise chipset is not // loaded and renders black while fading -> ugly if (Main_Data::game_player->IsTeleporting()) { FinishTeleportPlayer(); return; } Main_Data::game_party->UpdateTimers(); Game_Map::Update(); Main_Data::game_screen->Update(); spriteset->Update(); message_window->Update(); StartTeleportPlayer(); if (Game_Temp::gameover) { Game_Temp::gameover = false; Scene::Push(std::make_shared<Scene_Gameover>()); } if (Game_Temp::to_title) { Game_Temp::to_title = false; Scene::PopUntil(Scene::Title); } if (Game_Message::visible) return; // ESC-Menu calling if (Input::IsTriggered(Input::CANCEL)) { // Prevent calling when disabled or the main interpreter is running if (Game_System::GetAllowMenu() && !Game_Map::GetInterpreter().IsRunning()) { Game_Temp::menu_calling = true; } } if (Player::debug_flag) { if (Input::IsTriggered(Input::DEBUG_MENU)) { CallDebug(); } else if (Input::IsTriggered(Input::DEBUG_SAVE)) { CallSave(); } } if (!Main_Data::game_player->IsMoving()) { if (Game_Temp::menu_calling) { CallMenu(); return; } if (Game_Temp::name_calling) { CallName(); return; } if (Game_Temp::shop_calling) { CallShop(); return; } if (Game_Temp::save_calling) { CallSave(); return; } if (Game_Temp::load_calling) { CallLoad(); return; } if (Game_Temp::battle_calling) { CallBattle(); return; } } }
void Scene_Map::Update() { if (Main_Data::game_player->IsTeleporting()) { FinishTeleportPlayer(); } Game_Map::GetInterpreter().Update(); Main_Data::game_party->UpdateTimers(); Game_Map::Update(); Main_Data::game_player->Update(); Main_Data::game_screen->Update(); spriteset->Update(); message_window->Update(); StartTeleportPlayer(); if (Game_Temp::gameover) { Game_Temp::gameover = false; Scene::Push(EASYRPG_MAKE_SHARED<Scene_Gameover>()); } if (Game_Temp::to_title) { Game_Temp::to_title = false; Scene::PopUntil(Scene::Title); } if (Game_Message::visible) return; // ESC-Menu calling if (Input::IsTriggered(Input::CANCEL)) { Game_Temp::menu_calling = true; Game_Temp::menu_beep = true; } if (Player::debug_flag) { if (Input::IsTriggered(Input::DEBUG_MENU)) { CallDebug(); } else if (Input::IsTriggered(Input::DEBUG_SAVE)) { CallSave(); } } if (!Main_Data::game_player->IsMoving()) { if (Game_Temp::menu_calling) { CallMenu(); return; } if (Game_Temp::name_calling) { CallName(); return; } if (Game_Temp::shop_calling) { CallShop(); return; } if (Game_Temp::save_calling) { CallSave(); return; } if (Game_Temp::battle_calling) { CallBattle(); return; } if (Game_Temp::transition_processing) { Game_Temp::transition_processing = false; Graphics::Transition(Game_Temp::transition_type, 32, Game_Temp::transition_erase); } } }
void rpc2_PrintTraceElem(struct TraceElem *whichTE, long whichIndex, FILE *outFile) { long i; fprintf(outFile, "\nTrace Entry %ld: <<<<<< %s: %s", whichIndex, whichTE->ActiveLWP, CallName(whichTE->CallCode)); switch(whichTE->CallCode) { case SLNEWPACKET: case CLOCKTICK: fprintf(outFile, " >>>>>>\n"); break; default: fprintf(outFile, "() >>>>>>\n"); break; } switch(whichTE->CallCode) { case INIT: break; case EXPORT: { struct te_EXPORT *tea; tea = &whichTE->Args.ExportEntry; if (tea->Subsys.Tag == RPC2_SUBSYSBYID) fprintf(outFile, "Subsys: Tag = RPC2_SUBSYSBYID SubsysId = %ld\n", tea->Subsys.Value.SubsysId); else fprintf(outFile, "Subsys: Tag = RPC2_SUBSYSBYNAME Name = \"%s\"\n", tea->Subsys.Value.Name); break; /* switch */ } case DEEXPORT: { struct te_DEEXPORT *tea; tea = &whichTE->Args.DeExportEntry; if (tea->Subsys.Tag == RPC2_SUBSYSBYID) fprintf(outFile, "Subsys: Tag = RPC2_SUBSYSBYID SubsysId = %ld\n", tea->Subsys.Value.SubsysId); else fprintf(outFile, "Subsys: Tag = RPC2_SUBSYSBYNAME Name = \"%s\"\n", tea->Subsys.Value.Name); break; /* switch */ } case ALLOCBUFFER: { struct te_ALLOCBUFFER *tea; tea = &whichTE->Args.AllocBufferEntry; fprintf(outFile, "MinBodySize: %d\n", tea->MinBodySize); break; /* switch */ } case FREEBUFFER: { struct te_FREEBUFFER *tea; tea = &whichTE->Args.FreeBufferEntry; fprintf(outFile, "*BuffPtr: %p\n", tea->BuffPtr); break; /* switch */ } case SENDRESPONSE: { struct te_SENDRESPONSE *tea; tea = &whichTE->Args.SendResponseEntry; fprintf(outFile, "ConnHandle: %#x\n", tea->ConnHandle); break; /* switch */ } case GETREQUEST: { struct te_GETREQUEST *tea; tea = &whichTE->Args.GetRequestEntry; fprintf(outFile, "Filter: "); rpc2_PrintFilter(&tea->Filter, outFile); if (tea->IsNullBreathOfLife) fprintf(outFile, "BreathOfLife: NULL\n"); else fprintf(outFile, "BreathOfLife: %ld.%ld\n", tea->BreathOfLife.tv_sec, tea->BreathOfLife.tv_usec); break; /* switch */ } case MAKERPC: { struct te_MAKERPC *tea; tea = &whichTE->Args.MakeRPCEntry; fprintf(outFile, "Conn: %#x ", tea->ConnHandle); fprintf(outFile, "Enqueue: %d ", tea->EnqueueRequest); if (tea->IsNullBreathOfLife) fprintf(outFile, "BreathOfLife: NULL "); else fprintf(outFile, "BreathOfLife: %ld.%ld ", tea->BreathOfLife.tv_sec, tea->BreathOfLife.tv_usec); if (tea->IsNullSDesc) fprintf(outFile, "SDesc: NULL\n"); else {fprintf(outFile, "\nSDesc: "); rpc2_PrintSEDesc(&tea->SDesc, outFile);} break; /* switch */ } case MULTIRPC: { struct te_MULTIRPC *tea; tea = &whichTE->Args.MultiRPCEntry; fprintf(outFile, "ConnHandle: 0x%lx\n", (unsigned long)tea->ConnHandle); fprintf(outFile, "Request: OriginalAddress = %p ", tea->Request_Address); rpc2_PrintPacketHeader(&tea->Request, outFile); if (tea->IsNullSDesc) fprintf(outFile, "SDesc: NULL\n"); else {fprintf(outFile, "SDesc: "); rpc2_PrintSEDesc(&tea->SDesc, outFile);} fprintf(outFile, "HandleResult: %p\n", tea->HandleResult); if (tea->IsNullBreathOfLife) fprintf(outFile, "BreathOfLife: NULL\n"); else fprintf(outFile, "BreathOfLife: %ld.%ld\n", tea->BreathOfLife.tv_sec, tea->BreathOfLife.tv_usec); break; /* switch */ } case BIND: { struct te_BIND *tea; tea = &whichTE->Args.BindEntry; switch (tea->Host.Tag) { case RPC2_HOSTBYNAME: fprintf(outFile, "Host: Tag = RPC2_HOSTBYNAME Name = \"%s\"\n", tea->Host.Value.Name); break; case RPC2_HOSTBYADDRINFO: { char addr[RPC2_ADDRSTRLEN]; RPC2_formataddrinfo(tea->Host.Value.AddrInfo, addr, RPC2_ADDRSTRLEN); fprintf(outFile, "Host: Tag = RPC2_HOSTBYINETADDR AddrInfo = %s\n", addr); break; } case RPC2_HOSTBYINETADDR: fprintf(outFile, "Host: Tag = RPC2_HOSTBYINETADDR InetAddress = %s\n", inet_ntoa(tea->Host.Value.InetAddress)); break; default: fprintf(outFile, "Host: ?????????\n"); break; } switch (tea->Port.Tag) { case RPC2_PORTBYNAME: fprintf(outFile, "Port: Tag = RPC2_PORTBYNAME Name = \"%s\"\n", tea->Port.Value.Name); break; case RPC2_PORTBYINETNUMBER: fprintf(outFile, "Port: Tag = RPC2_PORTBYINETNUMBER InetNumber = \"%u\"\n", ntohs(tea->Port.Value.InetPortNumber)); break; default: fprintf(outFile, "Port: ??????\n"); break; } switch(tea->Subsys.Tag) { case RPC2_SUBSYSBYNAME: fprintf(outFile, "Subsys: Tag = RPC2_SUBSYSBYNAME Name = \"%s\"\n", tea->Subsys.Value.Name); break; case RPC2_SUBSYSBYID: fprintf(outFile, "Subsys: Tag = RPC2_SUBSYSBYID Name = %ld\n", tea->Subsys.Value.SubsysId); break; default: fprintf(outFile, "Subsys: ??????\n"); } fprintf(outFile, "SideEffectType = %d\n", tea->SideEffectType); if (tea->IsNullClientIdent) fprintf(outFile, "ClientIdent: NULL\n"); else { long max; fprintf(outFile, "ClientIdent: SeqLen = %u SeqBody\"", tea->ClientIdent.SeqLen); max = (tea->ClientIdent.SeqLen < sizeof(tea->ClientIdent_Value)) ? tea->ClientIdent.SeqLen : sizeof(tea->ClientIdent_Value); for (i = 0; i < max; i++) fprintf(outFile, "%c", (tea->ClientIdent_Value)[i]); if (max < tea->ClientIdent.SeqLen) fprintf(outFile, "....."); fprintf(outFile, "\"\n"); } break; /* switch */ } case INITSIDEEFFECT: { struct te_INITSIDEEFFECT *tea; tea = &whichTE->Args.InitSideEffectEntry; fprintf(outFile, "ConnHandle: %#x\n", tea->ConnHandle); if (tea->IsNullSDesc) fprintf(outFile, "SDesc: NULL\n"); else {fprintf(outFile, "SDesc: "); rpc2_PrintSEDesc(&tea->SDesc, outFile); } break; /* switch */ } case CHECKSIDEEFFECT: { struct te_CHECKSIDEEFFECT *tea; tea = &whichTE->Args.CheckSideEffectEntry; fprintf(outFile, "ConnHandle: %#x\n", tea->ConnHandle); if (tea->IsNullSDesc) fprintf(outFile, "SDesc: NULL\n"); else {fprintf(outFile, "SDesc: "); rpc2_PrintSEDesc(&tea->SDesc, outFile);} fprintf(outFile, "Flags: { "); if (tea->Flags & SE_AWAITLOCALSTATUS) fprintf(outFile, "SE_AWAITLOCALSTATUS "); if (tea->Flags & SE_AWAITREMOTESTATUS) fprintf(outFile, "SE_AWAITREMOTESTATUS "); fprintf(outFile, "}\n"); break; /* switch */ } case UNBIND: { struct te_UNBIND *tea; tea = &whichTE->Args.UnbindEntry; fprintf(outFile, "whichConn: %#x\n", tea->whichConn); break; /* switch */ } case GETPRIVATEPOINTER: { struct te_GETPRIVATEPOINTER *tea; tea = &whichTE->Args.GetPrivatePointerEntry; fprintf(outFile, "ConnHandle: %#x\n", tea->ConnHandle); break; /* switch */ } case SETPRIVATEPOINTER: { struct te_SETPRIVATEPOINTER *tea; tea = &whichTE->Args.SetPrivatePointerEntry; fprintf(outFile, "ConnHandle: %#x\n", tea->ConnHandle); fprintf(outFile, "PrivatePtr: %p\n", tea->PrivatePtr); break; /* switch */ } case GETSEPOINTER: { struct te_GETSEPOINTER *tea; tea = &whichTE->Args.GetSEPointerEntry; fprintf(outFile, "ConnHandle: %#x\n", tea->ConnHandle); break; /* switch */ } case SETSEPOINTER: { struct te_SETSEPOINTER *tea; tea = &whichTE->Args.SetSEPointerEntry; fprintf(outFile, "ConnHandle: %#x\n", tea->ConnHandle); fprintf(outFile, "SEPtr: %p\n", tea->SEPtr); break; /* switch */ } case GETPEERINFO: { struct te_GETPEERINFO *tea; tea = &whichTE->Args.GetPeerInfoEntry; fprintf(outFile, "ConnHandle: 0x%lx\n", (long)tea->ConnHandle); break; /* switch */ } case SLNEWPACKET: { struct te_SLNEWPACKET *tea; tea = &whichTE->Args.SLNewPacketEntry; rpc2_PrintPacketHeader(&tea->pb, outFile); break; /* switch */ } case SENDRELIABLY: { struct te_SENDRELIABLY *tea; tea = &whichTE->Args.SendReliablyEntry; fprintf(outFile, "Conn.UniqueCID = 0x%x ",tea->Conn_UniqueCID); if (tea->IsNullTimeout) fprintf(outFile, "TimeOut: NULL\n"); else fprintf(outFile, "TimeOut: %ld.%ld\n", tea->Timeout.tv_sec, tea->Timeout.tv_usec); break; /* switch */ } case MSENDPACKETSRELIABLY: { struct te_MSENDPACKETSRELIABLY *tea; tea = &whichTE->Args.MSendPacketsReliablyEntry; fprintf(outFile, "HowMany: %d ConnArray[0]: %p ConnArray[0].UniqueCID = 0x%x\n", tea->HowMany, tea->ConnArray0, tea->ConnArray0_UniqueCID); fprintf(outFile, "PacketArray[0]: OriginalAddress = 0x%lx ", (long)tea->PacketArray0_Address); rpc2_PrintPacketHeader(&tea->PacketArray0, outFile); if (tea->IsNullTimeout) fprintf(outFile, "TimeOut: NULL\n"); else fprintf(outFile, "TimeOut: %ld.%ld\n", tea->Timeout.tv_sec, tea->Timeout.tv_usec); break; /* switch */ } case XMITPACKET: { struct te_XMITPACKET *tea; tea = &whichTE->Args.XmitPacketEntry; fprintf(outFile, "whichSocket = %ld\n", tea->whichSocket); fprintf(outFile, "whichAddr: "); rpc2_printaddrinfo(&tea->whichAddr, outFile); fprintf(outFile,"\n"); rpc2_PrintPacketHeader(&tea->whichPB, outFile); break; /* switch */ } case CLOCKTICK: { struct te_CLOCKTICK *tea; tea = &whichTE->Args.ClockTickEntry; fprintf(outFile, "TimeNow: %d\n", tea->TimeNow); break; /* switch */ } case CREATEMGRP: { struct te_CREATEMGRP *tea; tea = &whichTE->Args.CreateMgrpEntry; fprintf(outFile, "MgroupHandle: %#x\n", tea->MgroupHandle); fprintf(outFile, "McastHost: "); rpc2_PrintHostIdent((RPC2_HostIdent *)&(tea->McastHost), outFile); fprintf(outFile, " "); fprintf(outFile, "McastPort: "); rpc2_PrintPortIdent(&(tea->Port), outFile); fprintf(outFile, " "); fprintf(outFile, "Subsystem: "); rpc2_PrintSubsysIdent(&(tea->Subsys), outFile); fprintf(outFile, "\n"); break; /* switch */ } case ADDTOMGRP: { struct te_ADDTOMGRP *tea; tea = &whichTE->Args.AddToMgrpEntry; fprintf(outFile, "MgroupHandle: %#x ConnHandle: %#x\n", tea->MgroupHandle, tea->ConnHandle); break; /* switch */ } case REMOVEFROMMGRP: { struct te_REMOVEFROMMGRP *tea; tea = &whichTE->Args.RemoveFromMgrpEntry; fprintf(outFile, "MEntry: "); rpc2_PrintMEntry(&tea->me, outFile); fprintf(outFile, " "); fprintf(outFile, "CEntry: "); rpc2_PrintCEntry(&tea->ce, outFile); fprintf(outFile, "\n"); break; /* switch */ } case XLATEMCASTPACKET: { struct te_XLATEMCASTPACKET *tea; tea = &whichTE->Args.XlateMcastPacketEntry; fprintf(outFile, "PacketBuffer Address: 0x%lx PacketHeader: ", tea->pb_address); rpc2_PrintPacketHeader(&tea->pb, outFile); fprintf(outFile, " ClientHost: "); rpc2_printaddrinfo(&tea->ThisAddr, outFile); fprintf(outFile, "\n"); break; /* switch */ } } }
void Scene_Map::Update() { Game_Map::GetInterpreter().Update(); Game_Map::Update(); Main_Data::game_player->Update(); Main_Data::game_screen->Update(); spriteset->Update(); message_window->Update(); UpdateTeleportPlayer(); if (Game_Temp::gameover) { Game_Temp::gameover = false; Scene::Push(EASYRPG_MAKE_SHARED<Scene_Gameover>()); } if (Game_Temp::to_title) { Game_Temp::to_title = false; Scene::PopUntil(Scene::Title); } if (Game_Message::visible) return; // ESC-Menu calling if (Input::IsTriggered(Input::CANCEL)) { //if (Game_Map::GetInterpreter().IsRunning()) //return; //$game_system.menu_disabled Game_Temp::menu_calling = true; Game_Temp::menu_beep = true; } if (!Main_Data::game_player->IsMoving()) { if (Game_Temp::menu_calling) { CallMenu(); return; } if (Game_Temp::name_calling) { CallName(); return; } if (Game_Temp::shop_calling) { CallShop(); return; } if (Game_Temp::save_calling) { CallSave(); return; } if (Game_Temp::battle_calling) { CallBattle(); return; } if (Game_Temp::transition_processing) { Game_Temp::transition_processing = false; Graphics::Transition(Game_Temp::transition_type, 32, Game_Temp::transition_erase); } } }