1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 22:19:54 +00:00
Commit graph

155 commits

Author SHA1 Message Date
David Cernat
e6c626f127 [General] Move handling of client globals to ClientScriptGlobal packet
ClientScriptGlobal is a new Worldstate packet that handles short, long and float values for global variables in clientside scripts.

Previously, short values were handled by the ScriptGlobalShort packet, while a partially implemented ScriptGlobalFloat packet also existed, but both of those packets were Object packets because they were added near the end of 2016 when only Player and Object packets existed (with the latter actually being called WorldEvent packets at the time). Both ScriptGlobalShort and ScriptGlobalFloat have now been removed.

The serverside script functions previously used to interact with ScriptGlobalShort have, however, been kept so they can be adjusted to work with local variables in clientside scripts instead in a future commit.
2020-01-04 09:56:37 +02:00
David Cernat
219f0cb88e [Client] Fix typo in 56f084c9c0 by using correct function 2019-09-23 07:55:16 +03:00
David Cernat
56f084c9c0 [Client] Fix packet spam for repetitive setting of the same global value 2019-09-15 16:10:09 +03:00
David Cernat
e424bd9bc3 [General] Implement ClientScriptSettings packet, part 2
The packet can now set which client globals get packets sent about them when their values change on clients.
2019-09-14 09:37:19 +03:00
David Cernat
8729c3c5e3 Add OpenMW commits up to 9 Mar 2019
# Conflicts:
#	.travis.yml
#	CI/before_script.linux.sh
#	README.md
#	apps/openmw/mwgui/jailscreen.cpp
#	apps/openmw/mwscript/animationextensions.cpp
#	apps/openmw/mwscript/guiextensions.cpp
#	apps/openmw/mwscript/miscextensions.cpp
#	apps/openmw/mwscript/soundextensions.cpp
2019-08-21 19:04:04 +03:00
David Cernat
fba07194cf Add OpenMW commits up to 29 Oct 2018
# Conflicts:
#	apps/openmw/mwbase/world.hpp
#	apps/openmw/mwinput/inputmanagerimp.cpp
#	apps/openmw/mwmechanics/actors.cpp
#	apps/openmw/mwmechanics/aicombat.cpp
#	apps/openmw/mwmechanics/character.cpp
#	apps/openmw/mwworld/worldimp.cpp
#	apps/openmw/mwworld/worldimp.hpp
2019-08-20 13:15:00 +03:00
David Cernat
0339958e21 [General] Rename Log class into TimedLog 2019-08-19 21:39:33 +03:00
Andrei Kortunov
3032b177a1 Remove redundant includes 2019-02-23 08:02:12 +04:00
David Cernat
fd40e8c971 [Client] Prevent ObjectState spam by not resending an already sent state 2019-01-15 14:26:00 +02:00
David Cernat
d9dd7073cf [General] Send certain packets only when logged in
Previously, client mods adding packet-sending scripts to the spawn area made clients send the associated packets as soon as they inputted their character name when joining a server using those mods. This made the clients either get disconnected for not replying to a handshake first, or it made them get kicked for sending object packets that are disallowed for players who are not logged in.

To fix this, LocalPlayer's hasFinishedCharGen() has been replaced with isLoggedIn(), because the former was already returning true when players inputted their names.
2018-10-13 15:36:13 +03:00
Andrei Kortunov
2961f0d810 Allow to use the %Name for creatures (bug #4644) 2018-09-16 21:53:28 +04:00
David Cernat
36ac2d9de4 [Client] Set packetOrigin for all ObjectList packets sent 2018-07-23 01:39:43 +03:00
David Cernat
63a86f145d [Client] Record type of each InterpreterContext for later checking 2018-07-23 00:46:07 +03:00
David Cernat
04ba324290 [Client] Disable clientside disabling and enabling of objects 2018-07-08 03:31:48 +03:00
David Cernat
c8ec77875c [Client] Update old comments for changes made by tes3mp 2018-05-26 05:11:41 +03:00
David Cernat
78234f9071 [General] Rename Event into ObjectList & WorldObject into BaseObject 2018-05-13 00:42:24 +03:00
David Cernat
9e5ddeac50
Merge pull request #408 from OpenMW/master
Add OpenMW commits up to 18 Apr 2018
2018-04-18 18:05:09 +03:00
tri4ng1e
d4d1703bcf
Some PVS-Studio and cppcheck fixes
cppcheck:
[apps/esmtool/record.cpp:697]: (performance) Prefer prefix ++/-- operators for non-primitive types.
[apps/esmtool/record.cpp:1126]: (performance) Prefer prefix ++/-- operators for non-primitive types.
[apps/esmtool/record.cpp:1138]: (performance) Prefer prefix ++/-- operators for non-primitive types.
[apps/niftest/niftest.cpp:36]: (performance) Function parameter 'filename' should be passed by reference.
[apps/niftest/niftest.cpp:41]: (performance) Function parameter 'filename' should be passed by reference.
[apps/opencs/model/prefs/boolsetting.cpp:25]: (warning) Possible leak in public function. The pointer 'mWidget' is not deallocated before it is allocated.
[apps/opencs/model/prefs/shortcuteventhandler.cpp:52]: (warning) Return value of std::remove() ignored. Elements remain in container.
[apps/openmw/mwstate/quicksavemanager.cpp:5]: (performance) Variable 'mSaveName' is assigned in constructor body. Consider performing initialization in initialization list.

PVS-Studio:
apps/opencs/model/filter/parser.cpp  582  warn  V560 A part of conditional expression is always true: allowPredefined.
apps/opencs/view/world/referencecreator.cpp  67  warn  V547 Expression '!errors.empty()' is always false.
apps/opencs/view/world/referencecreator.cpp  74  warn  V547 Expression '!errors.empty()' is always false.
apps/opencs/view/doc/loader.cpp  170  warn  V560 A part of conditional expression is always true: !completed.
apps/opencs/view/doc/loader.cpp  170  warn  V560 A part of conditional expression is always true: !error.empty().
apps/opencs/model/tools/pathgridcheck.cpp  32  err  V517 The use of 'if (A) {...} else if (A) {...}' pattern was detected. There is a probability of logical error presence. Check lines: 32, 34.
apps/opencs/model/world/refidadapterimp.cpp  1376  err  V547 Expression 'subColIndex < 3' is always true.

apps/openmw/mwgui/widgets.hpp  318  warn  V703 It is odd that the 'mEnableRepeat' field in derived class 'MWScrollBar' overwrites field in base class 'ScrollBar'. Check lines: widgets.hpp:318, MyGUI_ScrollBar.h:179.
apps/openmw/mwgui/widgets.hpp  319  warn  V703 It is odd that the 'mRepeatTriggerTime' field in derived class 'MWScrollBar' overwrites field in base class 'ScrollBar'. Check lines: widgets.hpp:319, MyGUI_ScrollBar.h:180.
apps/openmw/mwgui/widgets.hpp  320  warn  V703 It is odd that the 'mRepeatStepTime' field in derived class 'MWScrollBar' overwrites field in base class 'ScrollBar'. Check lines: widgets.hpp:320, MyGUI_ScrollBar.h:181
apps/openmw/mwmechanics/actors.cpp  1425  warn  V547 Expression '!detected' is always true.
apps/openmw/mwmechanics/character.cpp  2155  err  V547 Expression 'mode == 0' is always true.
apps/openmw/mwmechanics/character.cpp  1192  warn  V592 The expression was enclosed by parentheses twice: ((expression)). One pair of parentheses is unnecessary or misprint is present.
apps/openmw/mwmechanics/character.cpp  521  warn  V560 A part of conditional expression is always true: (idle == mIdleState).
apps/openmw/mwmechanics/pathfinding.cpp  317  err  V547 Expression 'mPath.size() >= 2' is always true.
apps/openmw/mwscript/interpretercontext.cpp  409  warn  V560 A part of conditional expression is always false: rank > 9.
apps/openmw/mwgui/windowbase.cpp  28  warn  V560 A part of conditional expression is always true: !visible.
apps/openmw/mwgui/journalwindow.cpp  561  warn  V547 Expression '!mAllQuests' is always false.
apps/openmw/mwgui/referenceinterface.cpp  18  warn  V571 Recurring check. The '!mPtr.isEmpty()' condition was already verified in line 16.
apps/openmw/mwworld/scene.cpp  463  warn  V547 Expression 'adjustPlayerPos' is always true.
apps/openmw/mwworld/worldimp.cpp  409  err  V766 An item with the same key '"sCompanionShare"' has already been added.
apps/openmw/mwworld/cellstore.cpp  691  warn  V519 The 'state.mWaterLevel' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 689, 691.
apps/openmw/mwworld/weather.cpp  1125  warn  V519 The 'mResult.mParticleEffect' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 1123, 1125.
apps/openmw/mwworld/weather.cpp  1137  warn  V519 The 'mResult.mParticleEffect' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 1135, 1137.

apps/wizard/unshield/unshieldworker.cpp  475  warn  V728 An excessive check can be simplified. The '(A && B) || (!A && !B)' expression is equivalent to the 'bool(A) == bool(B)' expression.
apps/wizard/installationpage.cpp  163  warn  V735 Possibly an incorrect HTML. The "</p" closing tag was encountered, while the "</span" tag was expected.

components/fontloader/fontloader.cpp  427  err  V547 Expression 'i == 1' is always true.
components/nifosg/nifloader.cpp  282  warn  V519 The 'created' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 278, 282.
components/esm/loadregn.cpp  119  err  V586 The 'clear' function is called twice for deallocation of the same resource. Check lines: 112, 119.
components/esm/cellref.cpp  178  warn  V581 The conditional expressions of the 'if' statements situated alongside each other are identical. Check lines: 175, 178.
components/esmterrain/storage.cpp  235  warn  V560 A part of conditional expression is always true: colStart == 0.
components/esmterrain/storage.cpp  237  warn  V560 A part of conditional expression is always true: rowStart == 0.
2018-04-18 12:36:10 +00:00
David Cernat
5d4b97645d Merge pull request #374 from OpenMW/master while resolving conflicts
# Conflicts:
#	apps/openmw/CMakeLists.txt
2018-01-27 22:52:59 +02:00
scrawl
1522bda60b
Fix crash in getDistance when invoked before the game starts 2018-01-11 01:48:05 +00:00
David Cernat
ac27ca663b [Client] Don't send ObjectState packets for items in containers 2017-08-20 06:58:39 +03:00
David Cernat
d51736d68f [Client] Fix crashes caused by inventory items with disabling scripts 2017-08-11 05:49:33 +03:00
David Cernat
7173a48f4b [Client] Prevent ObjectState packet spam 2017-07-20 17:01:04 +03:00
David Cernat
be93ec8ef6 [General] Implement ObjectState packet 2017-07-13 09:46:30 +03:00
David Cernat
fa3baac0f3 Merge pull request #228 from OpenMW/master while resolving conflicts
# Conflicts:
#	.travis.yml
#	CMakeLists.txt
#	apps/openmw/main.cpp
2017-06-18 18:16:10 +03:00
Bret Curtis
d785344fad purge all instances of <boost/shared_ptr.hpp>, clean up unused headers 2017-06-09 19:08:53 +02:00
David Cernat
dcc61a095a [Client] Allow multiple WorldObjects to be added to a WorldEvent 2017-05-06 20:44:39 +03:00
David Cernat
a82646a130 [Client] Delineate tes3mp-only code more clearly, part 2 2017-04-24 19:46:12 +03:00
David Cernat
a5484d237b Merge pull request #203 from OpenMW/master
Add OpenMW commits up to 21 Apr 2017, part 2
2017-04-21 21:07:37 +03:00
Allofich
ff3e307059 Pass parameters by const reference 2017-04-20 23:47:03 +09:00
David Cernat
9759764699 [Client] Clean up getting and resetting of WorldEvent 2017-04-05 09:04:41 +03:00
David Cernat
d7a760490e [Client] Simplify sending of world packets, part 2 2017-04-05 08:43:35 +03:00
David Cernat
2bd81c3de0 [Client] Use mpNum for every WorldObject 2017-04-04 11:07:16 +03:00
Koncord
690211ad99 [General] Extract BaseEvent & BasePlayer from packets to functions
Move Send and Read functions to BasePacket
2017-03-06 18:40:07 +08:00
Koncord
cea1425db1 [Client] Remove redundant newlines & keep ~120 columns 2017-03-04 14:55:35 +08:00
David Cernat
a58601fb2b [Client] Delineate tes3mp-only code more clearly, part 1 2017-02-26 16:59:53 +02:00
David Cernat
ed2176c984 [Client] Reuse 1 BaseEvent over and over instead of creating new ones 2017-02-23 09:19:09 +02:00
David Cernat
c8cbfbef62 [General] Sketch out server requests to players for container data 2017-02-14 19:31:56 +02:00
David Cernat
e703dd42aa [Client] Rename LocalEvent into WorldEvent 2017-02-06 17:40:32 +02:00
Koncord
f78c749981 [Client] Use "NULL" instead "nullptr"
nullptr keyword introduced in C++11
2017-02-01 15:58:29 +08:00
David Cernat
703f253712 [Client] Delete new LocalEvents after sending them 2017-01-31 09:48:37 +02:00
David Cernat
da2f66d6ba Merge pull request #135 from OpenMW/master
Add OpenMW commits up to 29 Jan
2017-01-30 07:32:44 +02:00
MiroslavR
d97e9cfe7e Fix InterpreterContext::updatePtr updating mLocals to the implicit ref's locals when interpreting a targeted global script (Fixes #3738)
The interpreter context of a targeted global script would point to the target's locals instead of the global script instance's locals when the target changed cell during script execution. Credit to scrawl for the solution.
2017-01-29 13:29:53 +01:00
David Cernat
9f1e491a75 [General] Make WorldEvents store information about multiple objects 2017-01-28 12:34:45 +02:00
David Cernat
624b85347a [Client] Create LocalEvent class and use it instead of WorldEvent 2017-01-27 20:57:47 +02:00
David Cernat
ee86c9161d [Client] Set InterpreterContext's sendPackets to false in constructor 2017-01-27 16:01:53 +02:00
David Cernat
c77120df6d Merge pull request #129 from OpenMW/master while resolving conflicts
# Conflicts:
#	apps/openmw/mwworld/actiontake.cpp
2017-01-19 06:34:09 +02:00
scrawl
45fb4f04b1 Update reference of the interpreter context when an Activate results in a take action (Fixes #3727) 2017-01-18 21:57:50 +01:00
scrawl
70c5f64caa Fix mLocals not being updated in InterpreterContext::updatePtr 2017-01-18 21:55:58 +01:00
Koncord
804259b2c9 Change some printf to LOG_MESSAGE_SIMPLE
printf is not streamed to files
2016-12-16 18:50:34 +08:00