| 363 | } |
| 364 | |
| 365 | ExtensionStateBase* ScriptExtender::GetCurrentExtensionState() |
| 366 | { |
| 367 | auto ctx = GetCurrentContextType(); |
| 368 | |
| 369 | if (ctx == ContextType::Server) { |
| 370 | if (server_.HasExtensionState()) { |
| 371 | return &server_.GetExtensionState(); |
| 372 | } else { |
| 373 | return nullptr; |
| 374 | } |
| 375 | } else if (ctx == ContextType::Client) { |
| 376 | if (client_.HasExtensionState()) { |
| 377 | return &client_.GetExtensionState(); |
| 378 | } else { |
| 379 | ERR("GetCurrentExtensionState() called from client thread %d, but no client state is available!", GetCurrentThreadId()); |
| 380 | return nullptr; |
| 381 | } |
| 382 | } else { |
| 383 | ERR("GetCurrentExtensionState() called from thread %d that is not bound to any context!", GetCurrentThreadId()); |
| 384 | if (client_.HasExtensionState()) { |
| 385 | return &client_.GetExtensionState(); |
| 386 | } else { |
| 387 | return nullptr; |
| 388 | } |
| 389 | } |
| 390 | } |
| 391 | |
| 392 | ecs::EntitySystemHelpersBase* ScriptExtender::GetECS(ecs::EntityWorld* world) |
| 393 | { |
no test coverage detected