Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged changes from private BitBucket repository #3

Merged
merged 3 commits into from
Dec 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 38 additions & 41 deletions UCDaccounts/login/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ addEventHandler("onClientMouseLeave", guiRoot,
function drawElements()
dxDrawRectangle(0, 0, sX, sY, tocolor(0, 0, 0, 75), false, false, false, false)
if (login.button.visible) then
dxDrawText("Remember my credentials", (1086 / nX) * sX, (595 / nY) * sY, (1329 / nX) * sX, (612 / nY) * sY, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "center", false, false, false, false, true)
dxDrawText("Remember my credentials", (1086 / nX) * sX, (595 / nY) * sY, (1329 / nX) * sX, (612 / nY) * sY, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "center", false, false, false, false, true)
dxDrawText("Account Name", (1047 / nX) * sX, (433 / nY) * sY, (1329 / nX) * sX, (463 / nY) * sY, tocolor(255, 255, 255, 255), 2, "default-bold", "left", "center", false, false, false, false, true)
dxDrawText("Password", (1047 / nX) * sX, (513 / nY) * sY, (1329 / nX) * sX, (543 / nY) * sY, tocolor(255, 255, 255, 255), 2, "default-bold", "left", "center", false, false, false, false, true)
end
Expand All @@ -118,18 +118,7 @@ function drawElements()
dxDrawText("Email", (1047 / nX) * sX, (413 / nY) * sY, (1329 / nX) * sX, (443 / nY) * sY, tocolor(255, 255, 255, 255), 2, "default-bold", "left", "center", false, false, false, false, true)
dxDrawText("Password", (1047 / nX) * sX, (493 / nY) * sY, (1329 / nX) * sX, (523 / nY) * sY, tocolor(255, 255, 255, 255), 2, "default-bold", "left", "center", false, false, false, false, true)
dxDrawText("Confirm Password", (1047 / nX) * sX, (573 / nY) * sY, (1329 / nX) * sX, (603 / nY) * sY, tocolor(255, 255, 255, 255), 2, "default-bold", "left", "center", false, false, false, false, true)

--dxDrawText("Account Name", (1047 / nX) * sX, (383 / nY) * sY, (1329 / nX) * sX, (413 / nY) * sY, tocolor(255, 255, 255, 255), 2, "default-bold", "left", "center", false, false, false, false, true)
--dxDrawText("Email", (1047 / nX) * sX, (463 / nY) * sY, (1329 / nX) * sX, (493 / nY) * sY, tocolor(255, 255, 255, 255), 2, "default-bold", "left", "center", false, false, false, false, true)
--dxDrawText("Password", (1047 / nX) * sX, (543 / nY) * sY, (1329 / nX) * sX, (573 / nY) * sY, tocolor(255, 255, 255, 255), 2, "default-bold", "left", "center", false, false, false, false, true)
--dxDrawText("Confirm Password", (1047 / nX) * sX, (623 / nY) * sY, (1329 / nX) * sX, (653 / nY) * sY, tocolor(255, 255, 255, 255), 2, "default-bold", "left", "center", false, false, false, false, true)
end

--dxDrawRectangle((567 / nX) * sX, (433 / nY) * sY, dxGetTextWidth("Login", 2, "default-bold"), (30 / nY) * sY, tocolor(0, 0, 0, 255), false, false, false, false)
--dxDrawRectangle((567 / nX) * sX, (483 / nY) * sY, dxGetTextWidth("Register", 2, "default-bold"), (30 / nY) * sY, tocolor(0, 0, 0, 255), false, false, false, false)
--dxDrawRectangle((567 / nX) * sX, (533 / nY) * sY, dxGetTextWidth("About UCD", 2, "default-bold"), (30 / nY) * sY, tocolor(0, 0, 0, 255), false, false, false, false)
--dxDrawRectangle((567 / nX) * sX, (583 / nY) * sY, dxGetTextWidth("Admins Online", 2, "default-bold"), (30 / nY) * sY, tocolor(0, 0, 0, 255), false, false, false, false)
--dxDrawRectangle((567 / nX) * sX, (633 / nY) * sY, dxGetTextWidth("Disconnect", 2, "default-bold"), (30 / nY) * sY, tocolor(0, 0, 0, 255), false, false, false, false)
end

dxDrawText("Login", (567 / nX) * sX, (433 / nY) * sY, (725 / nX) * sX, (463 / nY) * sY, tocolor(255, 255, 255, 255), scale[1], "default-bold", "left", "center", false, false, false, false, true)
dxDrawText("Register", (567 / nX) * sX, (483 / nY) * sY, (725 / nX) * sX, (513 / nY) * sY, tocolor(255, 255, 255, 255), scale[2], "default-bold", "left", "center", false, false, false, false, true)
Expand All @@ -156,11 +145,15 @@ function onClientClick(button, state, aX, aY)
end
-- Login button
if (aX >= lX and aX <= lW and aY >= lY and aY <= lH) then
for k, v in pairs(RPE) do
v.visible = false
if (RPE) then
for k, v in pairs(RPE) do
v.visible = false
end
end
for k, v in pairs(LPE) do
v.visible = true
if (LPE) then
for k, v in pairs(LPE) do
v.visible = true
end
end
end
end
Expand All @@ -182,7 +175,6 @@ addEventHandler("onClientResourceStart", resourceRoot,
if (not isPlayerLoggedIn(localPlayer)) then
triggerServerEvent("UCDaccounts.removeLoginText", resourceRoot)
triggerServerEvent("UCDadmin.banCheck", resourceRoot)
--triggerServerEvent("UCDaccounts.fetchUpdates", resourceRoot)

guiSetInputEnabled(true)

Expand All @@ -192,16 +184,17 @@ addEventHandler("onClientResourceStart", resourceRoot,
b.alpha = 0
end

login.button = GuiButton((1047 / nX) * sX, (622 / nY) * sY, (272 / nX) * sX, (42 / nY) * sY, "Login", false)
login.checkbox = GuiCheckBox((1061 / nX) * sX, (595 / nY) * sY, (15 / nX) * sX, (17 / nY) * sY, "", false, false)
login.edit["usr"] = GuiEdit((1037 / nX) * sX, (467 / nY) * sY, (292 / nX) * sX, (40 / nY) * sY, "", false)
login.edit["passwd"] = GuiEdit((1037 / nX) * sX, (549 / nY) * sY, (292 / nX) * sX, (40 / nY) * sY, "", false)
login.edit["passwd"].masked = true
login.memo = GuiMemo((577 / nX) * sX, (719 / nY) * sY, (740 / nX) * sX, (316 / nY) * sY, "", false)
login.memo.readOnly = true
login.memo.text = "Fetching updates.."
fetchRemote("http://ucdmta.com/updates.txt", displayUpdates)
login.button.enabled = true
login.button = GuiButton((1047 / nX) * sX, (622 / nY) * sY, (272 / nX) * sX, (42 / nY) * sY, "Login", false)
login.checkbox = GuiCheckBox((1061 / nX) * sX, (595 / nY) * sY, (15 / nX) * sX, (17 / nY) * sY, "", false, false)
login.edit["usr"] = GuiEdit((1037 / nX) * sX, (467 / nY) * sY, (292 / nX) * sX, (40 / nY) * sY, "", false)
login.edit["passwd"] = GuiEdit((1037 / nX) * sX, (549 / nY) * sY, (292 / nX) * sX, (40 / nY) * sY, "", false)
login.memo = GuiMemo((577 / nX) * sX, (719 / nY) * sY, (740 / nX) * sX, (316 / nY) * sY, "", false)
login.memo.text = "Fetching updates..."
login.memo.readOnly = true
login.edit["passwd"].masked = true
login.button.enabled = true

fetchRemote("http://ucdmta.com/updates.php", displayUpdates)

LPE = {login.button, login.checkbox, login.edit["usr"], login.edit["passwd"]}
for k, v in pairs(LPE) do
Expand All @@ -212,13 +205,13 @@ addEventHandler("onClientResourceStart", resourceRoot,
--addEventHandler("onClientGUIClick", login.button[2], onClickRegister, false)
--addEventHandler("onClientGUIChanged", guiRoot, onLoginEditsChanged)

registration.button = GuiButton((1047/ nX) * sX, (657 / nY) * sY, (272 / nX) * sX, (42 / nY) * sY, "Register", false)
registration.edit["usr"] = GuiEdit((1037/ nX) * sX, (367 / nY) * sY, (292 / nX) * sX, (40 / nY) * sY, "", false)
registration.edit["email"] = GuiEdit((1037/ nX) * sX, (447 / nY) * sY, (292 / nX) * sX, (40 / nY) * sY, "", false)
registration.edit["passwd"] = GuiEdit((1037/ nX) * sX, (527 / nY) * sY, (292 / nX) * sX, (40 / nY) * sY, "", false)
registration.edit["passwd_confirm"] = GuiEdit((1037/ nX) * sX, (607 / nY) * sY, (292 / nX) * sX, (40 / nY) * sY, "", false)
registration.edit["passwd"].masked = true
registration.edit["passwd_confirm"].masked = true
registration.button = GuiButton((1047/ nX) * sX, (657 / nY) * sY, (272 / nX) * sX, (42 / nY) * sY, "Register", false)
registration.edit["usr"] = GuiEdit((1037/ nX) * sX, (367 / nY) * sY, (292 / nX) * sX, (40 / nY) * sY, "", false)
registration.edit["email"] = GuiEdit((1037/ nX) * sX, (447 / nY) * sY, (292 / nX) * sX, (40 / nY) * sY, "", false)
registration.edit["passwd"] = GuiEdit((1037/ nX) * sX, (527 / nY) * sY, (292 / nX) * sX, (40 / nY) * sY, "", false)
registration.edit["passwd_confirm"] = GuiEdit((1037/ nX) * sX, (607 / nY) * sY, (292 / nX) * sX, (40 / nY) * sY, "", false)
registration.edit["passwd"].masked = true
registration.edit["passwd_confirm"].masked = true

--[[
registration.button = GuiButton((1047/ nX) * sX, (707 / nY) * sY, (272 / nX) * sX, (42 / nY) * sY, "Register", false)
Expand Down Expand Up @@ -453,13 +446,17 @@ function onClickRegister(button, state, login)
--guiBringToFront(registration.window[1])
--guiSetInputEnabled(true)

for _, v in pairs(RPE) do
v.visible = true
if (RPE) then
for _, v in pairs(RPE) do
v.visible = true
end
end

-- Hide other login elements
for _, v in pairs(LPE) do
v.visible = false
if (LPE) then
for _, v in pairs(LPE) do
v.visible = false
end
end

if (not isCursorShowing()) then showCursor(true) end
Expand Down Expand Up @@ -536,7 +533,7 @@ addEvent("UCDaccounts.login.destroyInterface", true)
addEventHandler("UCDaccounts.login.destroyInterface", root, destroyInterface)

function toggleLogin()
if (login.button and isElement(login.button)) then
if (login and login.button and isElement(login.button)) then
login.button.enabled = not login.button.enabled
end
end
Expand Down Expand Up @@ -591,4 +588,4 @@ function xmllol()
end
end
addEvent("UCDaccounts.login.saveAccountCredentials", true)
addEventHandler("UCDaccounts.login.saveAccountCredentials", root, xmllol)
addEventHandler("UCDaccounts.login.saveAccountCredentials", root, xmllol)
2 changes: 1 addition & 1 deletion UCDaccounts/login/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ local matrixViewPositions = {
{1862.90833, -1452.45300, 140.37985, 1528.33813, -1258.09937, 215.22653},
{1674.29980, -895.24408, 531.87439, 1659.51709, -982.78577, 39.61652},
{-903.80847, 1740.82678, 171.57216, -720.15826, 2015.47437, 56.53033},
-- My own bc I am god
-- My own bc I am [s]god[/s] I told you I don't believe in christmas kid - Risk (yes, bbc)
{1380.4105, -748.9726, 104.6013, 1460.8162, -1051.0956, 95.9769},
{2139.718, 1899.7533, 12.9899, 2034.3885, 1921.8209, 14.3957},
{-1211.5592, -2928.3223, 67.2434, -1071.653, -2823.7144, 46.9938},
Expand Down
1 change: 1 addition & 0 deletions UCDadmin/GUI/UCDatm/HEAD
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ref: refs/heads/master
4 changes: 4 additions & 0 deletions UCDadmin/GUI/UCDatm/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[core]
repositoryformatversion = 0
filemode = true
bare = true
1 change: 1 addition & 0 deletions UCDadmin/GUI/UCDatm/description
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Unnamed repository; edit this file 'description' to name the repository.
15 changes: 15 additions & 0 deletions UCDadmin/GUI/UCDatm/hooks/applypatch-msg.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh
#
# An example hook script to check the commit log message taken by
# applypatch from an e-mail message.
#
# The hook should exit with non-zero status after issuing an
# appropriate message if it wants to stop the commit. The hook is
# allowed to edit the commit message file.
#
# To enable this hook, rename this file to "applypatch-msg".

. git-sh-setup
commitmsg="$(git rev-parse --git-path hooks/commit-msg)"
test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"}
:
24 changes: 24 additions & 0 deletions UCDadmin/GUI/UCDatm/hooks/commit-msg.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh
#
# An example hook script to check the commit log message.
# Called by "git commit" with one argument, the name of the file
# that has the commit message. The hook should exit with non-zero
# status after issuing an appropriate message if it wants to stop the
# commit. The hook is allowed to edit the commit message file.
#
# To enable this hook, rename this file to "commit-msg".

# Uncomment the below to add a Signed-off-by line to the message.
# Doing this in a hook is a bad idea in general, but the prepare-commit-msg
# hook is more suited to it.
#
# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"

# This example catches duplicate Signed-off-by lines.

test "" = "$(grep '^Signed-off-by: ' "$1" |
sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || {
echo >&2 Duplicate Signed-off-by lines.
exit 1
}
8 changes: 8 additions & 0 deletions UCDadmin/GUI/UCDatm/hooks/post-update.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
#
# An example hook script to prepare a packed repository for use over
# dumb transports.
#
# To enable this hook, rename this file to "post-update".

exec git update-server-info
14 changes: 14 additions & 0 deletions UCDadmin/GUI/UCDatm/hooks/pre-applypatch.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
#
# An example hook script to verify what is about to be committed
# by applypatch from an e-mail message.
#
# The hook should exit with non-zero status after issuing an
# appropriate message if it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-applypatch".

. git-sh-setup
precommit="$(git rev-parse --git-path hooks/pre-commit)"
test -x "$precommit" && exec "$precommit" ${1+"$@"}
:
49 changes: 49 additions & 0 deletions UCDadmin/GUI/UCDatm/hooks/pre-commit.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".

if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi

# If you want to allow non-ASCII filenames set this variable to true.
allownonascii=$(git config --bool hooks.allownonascii)

# Redirect output to stderr.
exec 1>&2

# Cross platform projects tend to avoid non-ASCII filenames; prevent
# them from being added to the repository. We exploit the fact that the
# printable range starts at the space character and ends with tilde.
if [ "$allownonascii" != "true" ] &&
# Note that the use of brackets around a tr range is ok here, (it's
# even required, for portability to Solaris 10's /usr/bin/tr), since
# the square bracket bytes happen to fall in the designated range.
test $(git diff --cached --name-only --diff-filter=A -z $against |
LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
then
cat <<\EOF
Error: Attempt to add a non-ASCII file name.

This can cause problems if you want to work with people on other platforms.

To be portable it is advisable to rename the file.

If you know what you are doing you can disable this check using:

git config hooks.allownonascii true
EOF
exit 1
fi

# If there are whitespace errors, print the offending file names and fail.
exec git diff-index --check --cached $against --
53 changes: 53 additions & 0 deletions UCDadmin/GUI/UCDatm/hooks/pre-push.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/sh

# An example hook script to verify what is about to be pushed. Called by "git
# push" after it has checked the remote status, but before anything has been
# pushed. If this script exits with a non-zero status nothing will be pushed.
#
# This hook is called with the following parameters:
#
# $1 -- Name of the remote to which the push is being done
# $2 -- URL to which the push is being done
#
# If pushing without using a named remote those arguments will be equal.
#
# Information about the commits which are being pushed is supplied as lines to
# the standard input in the form:
#
# <local ref> <local sha1> <remote ref> <remote sha1>
#
# This sample shows how to prevent push of commits where the log message starts
# with "WIP" (work in progress).

remote="$1"
url="$2"

z40=0000000000000000000000000000000000000000

while read local_ref local_sha remote_ref remote_sha
do
if [ "$local_sha" = $z40 ]
then
# Handle delete
:
else
if [ "$remote_sha" = $z40 ]
then
# New branch, examine all commits
range="$local_sha"
else
# Update to existing branch, examine new commits
range="$remote_sha..$local_sha"
fi

# Check for WIP commit
commit=`git rev-list -n 1 --grep '^WIP' "$range"`
if [ -n "$commit" ]
then
echo >&2 "Found WIP commit in $local_ref, not pushing"
exit 1
fi
fi
done

exit 0
Loading