Malboro 23 Posted April 7 Привет! Сегодня поговорим о событиях Ссылка на проект: https://github.com/SirEleot/RageMpTutorial.git Share this post Link to post Share on other sites
Chipu 0 Posted April 19 Добрый день, сделал все как у вас, но при запуске появились ошибки. 1) В server.exe не показывает то, что события загрузились 2 ) При входе на сервер появляется окно с ошибкой: server packages could not be compiled successfully! Check clientside_cs.txt for C# logs Содержимое clientside_cs.txt:The invoked member is not supported in a dynamic assembly. System.Private.CoreLib at System.Reflection.Emit.InternalAssemblyBuilder.get_Location() The invoked member is not supported in a dynamic assembly. The invoked member is not supported in a dynamic assembly. System.Private.CoreLib at System.Reflection.Emit.InternalAssemblyBuilder.get_Location() The invoked member is not supported in a dynamic assembly. C#: compiling scripts.. The invoked member is not supported in a dynamic assembly. System.Private.CoreLib at System.Reflection.Emit.InternalAssemblyBuilder.get_Location() The invoked member is not supported in a dynamic assembly. C#: compiling scripts.. The invoked member is not supported in a dynamic assembly. System.Private.CoreLib at System.Reflection.Emit.InternalAssemblyBuilder.get_Location() The invoked member is not supported in a dynamic assembly. C#: compiling scripts.. The invoked member is not supported in a dynamic assembly. System.Private.CoreLib at System.Reflection.Emit.InternalAssemblyBuilder.get_Location() The invoked member is not supported in a dynamic assembly. C#: compiling scripts.. The invoked member is not supported in a dynamic assembly. System.Private.CoreLib at System.Reflection.Emit.InternalAssemblyBuilder.get_Location() The invoked member is not supported in a dynamic assembly. C#: compiling scripts.. Ссылка на сам сервер: https://yadi.sk/d/ePF-oJxZiqzXfQ Share this post Link to post Share on other sites
Malboro 23 Posted April 20 10 часов назад, Chipu сказал: Добрый день, сделал все как у вас, но при запуске появились ошибки. 1) В server.exe не показывает то, что события загрузились 2 ) При входе на сервер появляется окно с ошибкой: server packages could not be compiled successfully! Check clientside_cs.txt for C# logs Содержимое clientside_cs.txt:The invoked member is not supported in a dynamic assembly. System.Private.CoreLib at System.Reflection.Emit.InternalAssemblyBuilder.get_Location() The invoked member is not supported in a dynamic assembly. The invoked member is not supported in a dynamic assembly. System.Private.CoreLib at System.Reflection.Emit.InternalAssemblyBuilder.get_Location() The invoked member is not supported in a dynamic assembly. C#: compiling scripts.. The invoked member is not supported in a dynamic assembly. System.Private.CoreLib at System.Reflection.Emit.InternalAssemblyBuilder.get_Location() The invoked member is not supported in a dynamic assembly. C#: compiling scripts.. The invoked member is not supported in a dynamic assembly. System.Private.CoreLib at System.Reflection.Emit.InternalAssemblyBuilder.get_Location() The invoked member is not supported in a dynamic assembly. C#: compiling scripts.. The invoked member is not supported in a dynamic assembly. System.Private.CoreLib at System.Reflection.Emit.InternalAssemblyBuilder.get_Location() The invoked member is not supported in a dynamic assembly. C#: compiling scripts.. The invoked member is not supported in a dynamic assembly. System.Private.CoreLib at System.Reflection.Emit.InternalAssemblyBuilder.get_Location() The invoked member is not supported in a dynamic assembly. C#: compiling scripts.. Ссылка на сам сервер: https://yadi.sk/d/ePF-oJxZiqzXfQ Проблема в том что при динамической сборке проекта, как на клиентской части, нельзя использовать переменные типа var. Проверь свой код клиентской части на их наличие. Вместо var можно использовать dynamic Share this post Link to post Share on other sites
Chipu 0 Posted April 20 2 часа назад, Malboro сказал: Проблема в том что при динамической сборке проекта, как на клиентской части, нельзя использовать переменные типа var. Проверь свой код клиентской части на их наличие. Вместо var можно использовать dynamic https://imgur.com/FTmVhtQ Я их вроде не использовал Share this post Link to post Share on other sites
Malboro 23 Posted April 20 10 минут назад, Chipu сказал: https://imgur.com/FTmVhtQ Я их вроде не использовал public class ClientTest { //ne suda public ClientTest() { Events.OnPlayerChat += OnPlayerChat; Events.Add("cl_TestEvent", OnTestEvent); } Первое что бросается в глаза - не унаследовался от класса Events.Script Share this post Link to post Share on other sites
Chipu 0 Posted April 20 3 часа назад, Malboro сказал: public class ClientTest { //ne suda public ClientTest() { Events.OnPlayerChat += OnPlayerChat; Events.Add("cl_TestEvent", OnTestEvent); } Первое что бросается в глаза - не унаследовался от класса Events.Script Да, действительно. Решил сделать рефакторинг проекта. Ошибок теперь же нет, но события не вызываютсяКод: https://yadi.sk/d/SDhAozfIEpGZXQ Share this post Link to post Share on other sites
Malboro 23 Posted April 20 2 минуты назад, Chipu сказал: Да, действительно. Решил сделать рефакторинг проекта. Ошибок теперь же нет, но события не вызываютсяКод: https://yadi.sk/d/SDhAozfIEpGZXQ Какие именно события не вызываются на клиенте или на сервере, в серверной консоли что-то выводится при подключении? Если не работают клиентские события нужно убедится в наличии файла enable-clientside-cs.txt в папке с Rage Share this post Link to post Share on other sites
Chipu 0 Posted April 20 (edited) 2 часа назад, Malboro сказал: Какие именно события не вызываются на клиенте или на сервере, в серверной консоли что-то выводится при подключении? Если не работают клиентские события нужно убедится в наличии файла enable-clientside-cs.txt в папке с Rage Консоль:[N] Starting network... - OK: (IPv4-only) at 127.0.0.1:22005 (node:13348) ExperimentalWarning: The ESM module loader is experimental. Loading packages Initializing bridge (0.3.7.0).. Initializing Bootstrapper.dll (0.3.7.0).. -> SERVER STARTED AT 20.04.2019 13:00:08 Unable to load acl.xml ACLEnabled: False Loaded 451 entries from vehicleData.json Loading resources.. -> Starting Alpha resource.. Alpha: loading scripts.. found 1 script(s) -> Resource Alpha started! Started! Waiting for connections.. [P] Plugin bridge.dll loaded! Started HTTP server at 22006 port. Файл enable-clientside-cs.txt есть - https://imgur.com/BBqVjdq Событие не вызываются как на клиенте, так и на сервере Edited April 20 by Chipu Share this post Link to post Share on other sites
Malboro 23 Posted April 20 21 минуту назад, Chipu сказал: Консоль:[N] Starting network... - OK: (IPv4-only) at 127.0.0.1:22005 (node:13348) ExperimentalWarning: The ESM module loader is experimental. Loading packages Initializing bridge (0.3.7.0).. Initializing Bootstrapper.dll (0.3.7.0).. -> SERVER STARTED AT 20.04.2019 13:00:08 Unable to load acl.xml ACLEnabled: False Loaded 451 entries from vehicleData.json Loading resources.. -> Starting Alpha resource.. Alpha: loading scripts.. found 1 script(s) -> Resource Alpha started! Started! Waiting for connections.. [P] Plugin bridge.dll loaded! Started HTTP server at 22006 port. Файл enable-clientside-cs.txt есть - https://imgur.com/BBqVjdq Событие не вызываются как на клиенте, так и на сервере твой meta.xml <meta> <info name="Alpha" type="script"/> <script src="Server"/> </meta> мой <meta> <info name="Tuter" type="script"/> <script src="Server.dll"/> </meta> Share this post Link to post Share on other sites
Chipu 0 Posted April 20 2 часа назад, Malboro сказал: твой meta.xml <meta> <info name="Alpha" type="script"/> <script src="Server"/> </meta> мой <meta> <info name="Tuter" type="script"/> <script src="Server.dll"/> </meta> Спасибо, теперь все работает) У вас в видеоролике по серверной стороне src="Server", добавьте примечание, может кто тоже запутается Share this post Link to post Share on other sites